summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2008-10-06 16:06:59 +0200
committerGuilhem Bichot <guilhem@mysql.com>2008-10-06 16:06:59 +0200
commitf8670e2c53dbd38fab2b5fd4c28025fb0f48a9ed (patch)
tree8b322cd1624911449002f4a3749fbc58181d2648 /sql/sql_class.h
parent0b097b777768f6a01d02411f7b78e4fce9e55a45 (diff)
downloadmariadb-git-f8670e2c53dbd38fab2b5fd4c28025fb0f48a9ed.tar.gz
Fix for BUG#31612
"Trigger fired multiple times leads to gaps in auto_increment sequence". The bug was that if a trigger fired multiple times inside a top statement (for example top-statement is a multi-row INSERT, and trigger is ON INSERT), and that trigger inserted into an auto_increment column, then gaps could be observed in the auto_increment sequence, even if there were no other users of the database (no concurrency). It was wrong usage of THD::auto_inc_intervals_in_cur_stmt_for_binlog. Note that the fix changes "class handler", I'll tell the Storage Engine API team.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 60051ed02cc..82c162f923f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1524,6 +1524,9 @@ public:
then the latter INSERT will insert no rows
(first_successful_insert_id_in_cur_stmt == 0), but storing "INSERT_ID=3"
in the binlog is still needed; the list's minimum will contain 3.
+ This variable is cumulative: if several statements are written to binlog
+ as one (stored functions or triggers are used) this list is the
+ concatenation of all intervals reserved by all statements.
*/
Discrete_intervals_list auto_inc_intervals_in_cur_stmt_for_binlog;
/* Used by replication and SET INSERT_ID */