Commit 1211b9a5 authored by guilhem@mysql.com's avatar guilhem@mysql.com

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.
parent a496daf7
...@@ -671,9 +671,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) ...@@ -671,9 +671,9 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db)
fprintf(file, "LOAD DATA INFILE '%s' ", fname); fprintf(file, "LOAD DATA INFILE '%s' ", fname);
if(sql_ex.opt_flags && REPLACE_FLAG ) if(sql_ex.opt_flags & REPLACE_FLAG )
fprintf(file," REPLACE "); fprintf(file," REPLACE ");
else if(sql_ex.opt_flags && IGNORE_FLAG ) else if(sql_ex.opt_flags & IGNORE_FLAG )
fprintf(file," IGNORE "); fprintf(file," IGNORE ");
fprintf(file, "INTO TABLE %s ", table_name); fprintf(file, "INTO TABLE %s ", table_name);
...@@ -685,7 +685,7 @@ void Load_log_event::print(FILE* file, bool short_form, char* last_db) ...@@ -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.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," OPTIONALLY ");
fprintf(file, " ENCLOSED BY "); fprintf(file, " ENCLOSED BY ");
pretty_print_char(file, sql_ex.enclosed); 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) ...@@ -1100,9 +1100,9 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
else else
{ {
enum enum_duplicates handle_dup = DUP_IGNORE; 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; 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 ); 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), 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