summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-12-01 22:24:49 +0200
committerMichael Widenius <monty@askmonty.org>2010-12-01 22:24:49 +0200
commit1a2df3f4eb403875406a72c39efce8a2fb6d32ac (patch)
tree9281b03f843a743d3d4db19828044eaa24406dc9 /sql/log_event.cc
parent863a493b4f521eb7a5002e2dea6c0148ed1ada0b (diff)
parent41df9be0ff28a4a63ba9042d6b67557092018cac (diff)
downloadmariadb-git-1a2df3f4eb403875406a72c39efce8a2fb6d32ac.tar.gz
automatic merge with 5.1
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 2268b61b492..fb4fc5b79b3 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3307,6 +3307,19 @@ START SLAVE; . Query: '%s'", expected_error, thd->query());
/* If the query was not ignored, it is printed to the general log */
if (!thd->is_error() || thd->main_da.sql_errno() != ER_SLAVE_IGNORED_TABLE)
general_log_write(thd, COM_QUERY, thd->query(), thd->query_length());
+ else
+ {
+ /*
+ Bug#54201: If we skip an INSERT query that uses auto_increment, then we
+ should reset any @@INSERT_ID set by an Intvar_log_event associated with
+ the query; otherwise the @@INSERT_ID will linger until the next INSERT
+ that uses auto_increment and may affect extra triggers on the slave etc.
+
+ We reset INSERT_ID unconditionally; it is probably cheaper than
+ checking if it is necessary.
+ */
+ thd->auto_inc_intervals_forced.empty();
+ }
compare_errors: