diff options
-rw-r--r-- | client/Makefile.am | 4 | ||||
-rwxr-xr-x | mysql-test/t/rpl000017-slave.sh | 4 | ||||
-rw-r--r-- | sql/slave.cc | 8 | ||||
-rw-r--r-- | strings/strmake.c | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/client/Makefile.am b/client/Makefile.am index 380c9f2acbe..d1b16870f67 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -19,13 +19,13 @@ INCLUDES = -I$(srcdir)/../include \ -I../include -I$(srcdir)/.. -I$(top_srcdir) \ -I.. -noinst_HEADERS = client_priv.h LIBS = @CLIENT_LIBS@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \ mysqldump mysqlimport mysqltest mysqlbinlog noinst_PROGRAMS = insert_test select_test thread_test -noinst_HEADERS = sql_string.h completion_hash.h my_readline.h +noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \ + client_priv.h mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS) mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) diff --git a/mysql-test/t/rpl000017-slave.sh b/mysql-test/t/rpl000017-slave.sh index 269e144e278..0588859c591 100755 --- a/mysql-test/t/rpl000017-slave.sh +++ b/mysql-test/t/rpl000017-slave.sh @@ -3,7 +3,7 @@ master-bin.001 4 127.0.0.1 replicate -aaaaaaaaaaaaaaab -9306 +aaaaaaaaaaaaaaabthispartofthepasswordisnotused +$MASTER_MYPORT 1 EOF diff --git a/sql/slave.cc b/sql/slave.cc index 52cde738b9a..2e0861bbd56 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -299,7 +299,7 @@ static int init_strvar_from_file(char* var, int max_size, IO_CACHE* f, } else if (default_val) { - strmake(var, default_val, max_size); + strmake(var, default_val, max_size-1); return 0; } return 1; @@ -530,14 +530,14 @@ int init_master_info(MASTER_INFO* mi) } mi->log_file_name[length-1]= 0; // kill \n - char buf[FN_REFLEN]; - if(!my_b_gets(&mi->file, buf, sizeof(buf))) + /* Reuse fname buffer */ + if(!my_b_gets(&mi->file, fname, sizeof(fname))) { msg="Error reading log file position from master info file"; goto error; } + mi->pos = strtoull(fname,(char**) 0, 10); - mi->pos = strtoull(buf,(char**) 0, 10); mi->fd = fd; if(init_strvar_from_file(mi->host, sizeof(mi->host), &mi->file, master_host) || diff --git a/strings/strmake.c b/strings/strmake.c index d4edce689a5..66a230338a1 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -22,7 +22,8 @@ strmake(dst,src,length) moves length characters, or until end, of src to dst and appends a closing NUL to dst. - strmake() returns pointer to closing null; + Note that is strlen(src) >= length then dst[length] will be set to \0 + strmake() returns pointer to closing null */ #include <global.h> |