summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2003-04-01 18:19:15 +0200
committerguilhem@mysql.com <>2003-04-01 18:19:15 +0200
commit1211b9a513df1b17198235375770a0ddf585a789 (patch)
treeeaa34da2fa8fc62e66e3d4afc3e0bfae233b4ead /sql
parenta496daf777c64a3bfdd89ea084023c6c40e15460 (diff)
downloadmariadb-git-1211b9a513df1b17198235375770a0ddf585a789.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event.cc6
-rw-r--r--sql/slave.cc4
2 files changed, 5 insertions, 5 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index c30d03adaf5..7c4c893a823 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -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);
diff --git a/sql/slave.cc b/sql/slave.cc
index 358a908e0cc..ac65bd2bdc3 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -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),