summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-03-08 14:47:13 +0100
committerguilhem@mysql.com <>2004-03-08 14:47:13 +0100
commit2c31370a30be4dc82b3688da0b60c7ad66fee1fe (patch)
treee439202deb9c5709108ea9af38614de7ef51c91d /sql
parent9c4b9e6df1576fad4fa2cb7e89da2614c282449f (diff)
downloadmariadb-git-2c31370a30be4dc82b3688da0b60c7ad66fee1fe.tar.gz
Fix for BUG#3081 "if an INSERT DELAYED is killed, it is binlogged as killed but it's not needed".
INSERT DELAYED works only for one-row inserts (in latest 4.0 versions at least). So killing a delayed_insert thread does not spoil replication: the rows which actually went into the table are exactly those listed in the binlog. So when the delayed_insert thread is killed, don't log it as 'killed', because it causes superfluous stops on the slave.
Diffstat (limited to 'sql')
-rw-r--r--sql/log_event.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 603c8431b03..d2957165e77 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -820,7 +820,9 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
ulong query_length, bool using_trans)
:Log_event(thd_arg, 0, using_trans), data_buf(0), query(query_arg),
db(thd_arg->db), q_len((uint32) query_length),
- error_code(thd_arg->killed ? ER_SERVER_SHUTDOWN: thd_arg->net.last_errno),
+ error_code(thd_arg->killed ?
+ ((thd_arg->system_thread & SYSTEM_THREAD_DELAYED_INSERT) ?
+ 0 : ER_SERVER_SHUTDOWN) : thd_arg->net.last_errno),
thread_id(thd_arg->thread_id),
/* save the original thread id; we already know the server id */
slave_proxy_id(thd_arg->slave_proxy_id)