summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorguilhem@mysql.com <>2004-03-04 15:44:24 +0100
committerguilhem@mysql.com <>2004-03-04 15:44:24 +0100
commit9beae2895f904f52169ba5b75386b2fee423a45b (patch)
treef70a16ca072f927cf34e3564c44fbb1b5a94806a /sql/sql_base.cc
parent08b11e2f66ea3a7b77b250c41181ed64f43799a4 (diff)
downloadmariadb-git-9beae2895f904f52169ba5b75386b2fee423a45b.tar.gz
Fix for BUG#3063 "Don't mark an auto DROP TEMP TABLE as 'killed' in the binlog";
even if the thread was killed, we write the DROP with error_code=0. This will remove unneeded stops on slave, and will lose nothing: if a real update was killed, this real update will be logged with the nonzero error code and will cause the stop on slave.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index e45471dabb8..95ef7acb5ab 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -582,6 +582,16 @@ void close_temporary_tables(THD *thd)
/* The -1 is to remove last ',' */
thd->clear_error();
Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0);
+ /*
+ Imagine the thread had created a temp table, then was doing a SELECT, and
+ the SELECT was killed. Then it's not clever to mark the statement above as
+ "killed", because it's not really a statement updating data, and there
+ are 99.99% chances it will succeed on slave.
+ If a real update (one updating a persistent table) was killed on the
+ master, then this real update will be logged with error_code=killed,
+ rightfully causing the slave to stop.
+ */
+ qinfo.error_code= 0;
mysql_bin_log.write(&qinfo);
}
thd->temporary_tables=0;