Commit 241b6c05 authored by unknown's avatar unknown

Small-and-safe fix for bug #218: "LOAD DATA INFILE IGNORE is well

logged, but read as LOAD DATA INFILE REPLACE"
This was just bad && instead of &, but nasty consequences.
This should be merged to 4.0 BUT it will not be automatic (some code
has moved from log_event.h to log_event.cc, and log_event.cc has changed);
please Merging Man, do 'bk grep REPLACE_FLAG' in 4.0/sql
to find all the new places.


sql/log_event.cc:
  & instead of && when testing flags
sql/slave.cc:
  & instead of && when testing flags
parent f9df0fee
......@@ -671,9 +671,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
fprintf(file, "LOAD DATA INFILE '%s' ", fname);
if(sql_ex.opt_flags && REPLACE_FLAG )
if(sql_ex.opt_flags & REPLACE_FLAG )
fprintf(file," REPLACE ");
else if(sql_ex.opt_flags && IGNORE_FLAG )
else if(sql_ex.opt_flags & IGNORE_FLAG )
fprintf(file," IGNORE ");
fprintf(file, "INTO TABLE %s ", table_name);
......@@ -685,7 +685,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
if(!(sql_ex.empty_flags & ENCLOSED_EMPTY))
{
if(sql_ex.opt_flags && OPT_ENCLOSED_FLAG )
if(sql_ex.opt_flags & OPT_ENCLOSED_FLAG )
fprintf(file," OPTIONALLY ");
fprintf(file, " ENCLOSED BY ");
pretty_print_char(file, sql_ex.enclosed);
......
......@@ -1100,9 +1100,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
else
{
enum enum_duplicates handle_dup = DUP_IGNORE;
if(lev->sql_ex.opt_flags && REPLACE_FLAG)
if(lev->sql_ex.opt_flags & REPLACE_FLAG)
handle_dup = DUP_REPLACE;
sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags &&
sql_exchange ex((char*)lev->fname, lev->sql_ex.opt_flags &
DUMPFILE_FLAG );
String field_term(&lev->sql_ex.field_term, 1),
enclosed(&lev->sql_ex.enclosed, 1),
......
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