diff options
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index cda385c911b..4d260763491 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1810,24 +1810,13 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, thd->query= load_data_query; } - /* - We need to set thd->lex->sql_command and thd->lex->duplicates - since InnoDB tests these variables to decide if this is a LOAD - DATA ... REPLACE INTO ... statement even though mysql_parse() - is not called. This is not needed in 5.0 since there the LOAD - DATA ... statement is replicated using mysql_parse(), which - sets the thd->lex fields correctly. - */ - thd->lex->sql_command= SQLCOM_LOAD; if (sql_ex.opt_flags & REPLACE_FLAG) { - thd->lex->duplicates= DUP_REPLACE; handle_dup= DUP_REPLACE; } else if (sql_ex.opt_flags & IGNORE_FLAG) { ignore= 1; - thd->lex->duplicates= DUP_ERROR; handle_dup= DUP_ERROR; } else @@ -1845,9 +1834,18 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, If reading from net (a 3.23 master), mysql_load() will change this to IGNORE. */ - thd->lex->duplicates= DUP_ERROR; handle_dup= DUP_ERROR; } + /* + We need to set thd->lex->sql_command and thd->lex->duplicates + since InnoDB tests these variables to decide if this is a LOAD + DATA ... REPLACE INTO ... statement even though mysql_parse() + is not called. This is not needed in 5.0 since there the LOAD + DATA ... statement is replicated using mysql_parse(), which + sets the thd->lex fields correctly. + */ + thd->lex->sql_command= SQLCOM_LOAD; + thd->lex->duplicates= handle_dup; sql_exchange ex((char*)fname, sql_ex.opt_flags & DUMPFILE_FLAG); String field_term(sql_ex.field_term,sql_ex.field_term_len,log_cs); |