sql/log.cc

    fixed bug in find_first_log
sql/mysqlbinlog.cc
    flose file only if we opened it
sql/slave.cc
    changed spacing
sql/sql_repl.cc
    fixed error message
parent ea0f9d35
...@@ -176,3 +176,6 @@ repl-tests/test-repl-ts/repl-timestamp.master.reject ...@@ -176,3 +176,6 @@ repl-tests/test-repl-ts/repl-timestamp.master.reject
client/.mysqladmin.c.swp client/.mysqladmin.c.swp
repl-tests/test-repl/sum-wlen-slave.master.reje repl-tests/test-repl/sum-wlen-slave.master.reje
support-files/mysql-3.23.28-gamma.spec support-files/mysql-3.23.28-gamma.spec
repl-tests/test-repl/foo-dump-slave.master.
repl-tests/test-repl/sum-wlen-slave.master.
repl-tests/test-repl/sum-wlen-slave.master.re
...@@ -267,7 +267,7 @@ int MYSQL_LOG::find_first_log(LOG_INFO* linfo, const char* log_name) ...@@ -267,7 +267,7 @@ int MYSQL_LOG::find_first_log(LOG_INFO* linfo, const char* log_name)
// if the log entry matches, empty string matching anything // if the log entry matches, empty string matching anything
if (!log_name_len || if (!log_name_len ||
(log_name_len == length+1 && fname[log_name_len] == '\n' && (log_name_len == length-1 && fname[log_name_len] == '\n' &&
!memcmp(fname, log_name, log_name_len))) !memcmp(fname, log_name, log_name_len)))
{ {
fname[length-1]=0; // remove last \n fname[length-1]=0; // remove last \n
......
...@@ -310,7 +310,7 @@ Unfortunately, no sweepstakes today, adjusted position to 4\n"); ...@@ -310,7 +310,7 @@ Unfortunately, no sweepstakes today, adjusted position to 4\n");
static void dump_local_log_entries(const char* logname) static void dump_local_log_entries(const char* logname)
{ {
File fd; File fd = -1;
IO_CACHE cache,*file= &cache; IO_CACHE cache,*file= &cache;
int rec_count = 0; int rec_count = 0;
...@@ -368,7 +368,8 @@ read error", ...@@ -368,7 +368,8 @@ read error",
rec_count++; rec_count++;
delete ev; delete ev;
} }
my_close(fd, MYF(MY_WME)); if(fd >= 0)
my_close(fd, MYF(MY_WME));
end_io_cache(file); end_io_cache(file);
} }
......
...@@ -759,8 +759,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len) ...@@ -759,8 +759,10 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags && sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags &&
DUMPFILE_FLAG ); DUMPFILE_FLAG );
String field_term(&lev->sql_ex.field_term, 1), String field_term(&lev->sql_ex.field_term, 1),
enclosed(&lev->sql_ex.enclosed, 1), line_term(&lev->sql_ex.line_term,1), enclosed(&lev->sql_ex.enclosed, 1),
escaped(&lev->sql_ex.escaped, 1), line_start(&lev->sql_ex.line_start, 1); line_term(&lev->sql_ex.line_term,1),
escaped(&lev->sql_ex.escaped, 1),
line_start(&lev->sql_ex.line_start, 1);
ex.field_term = &field_term; ex.field_term = &field_term;
if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY) if(lev->sql_ex.empty_flags & FIELD_TERM_EMPTY)
......
...@@ -256,7 +256,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags) ...@@ -256,7 +256,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, ulong pos, ushort flags)
if(pos < 4) if(pos < 4)
{ {
errmsg = "Contratulations! You have hit the magic number and can win \ errmsg = "Congratulations! You have hit the magic number and can win \
sweepstakes if you report the bug"; sweepstakes if you report the bug";
goto err; goto err;
} }
...@@ -291,6 +291,8 @@ sweepstakes if you report the bug"; ...@@ -291,6 +291,8 @@ sweepstakes if you report the bug";
packet->length(0); packet->length(0);
packet->append("\0",1); packet->append("\0",1);
} }
if(error != LOG_READ_EOF) if(error != LOG_READ_EOF)
{ {
switch(error) switch(error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment