diff options
author | unknown <mats@mysql.com> | 2005-07-05 13:55:54 +0200 |
---|---|---|
committer | unknown <mats@mysql.com> | 2005-07-05 13:55:54 +0200 |
commit | 28f554af12c934acdaa13d673edc5bd51a4567c8 (patch) | |
tree | 435fc6931826a8e0903cc525eb1e2f124332a3f3 /sql/log_event.cc | |
parent | 0ff72e6019d8f9deec9159db87cf7947142539b3 (diff) | |
download | mariadb-git-28f554af12c934acdaa13d673edc5bd51a4567c8.tar.gz |
Bug#11401: Setting thd->lex so that engines (i.e., InnoDB) recognizes
this as a LOAD DATA ... REPLACE INTO .. statement.
sql/log_event.cc:
Setting thd->lex so that engines (i.e., InnoDB) recognizes this
as a LOAD DATA ... REPLACE INTO .. statement.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index a4319f63b83..cda385c911b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1809,11 +1809,25 @@ int Load_log_event::exec_event(NET* net, struct st_relay_log_info* rli, "` <...>", NullS) - load_data_query); 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 @@ -1831,6 +1845,7 @@ 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; } |