summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2004-11-16 20:37:42 +0200
committerunknown <heikki@hundin.mysql.fi>2004-11-16 20:37:42 +0200
commit305a9468ce30221c14452ce36cc00a378488fd2f (patch)
tree1b97744780d7c68e9b09266ff26bf0f9dc82c4b5
parent108b55b43bf94fcced85da3bbe639cd003a4d353 (diff)
downloadmariadb-git-305a9468ce30221c14452ce36cc00a378488fd2f.tar.gz
ha_innodb.cc:
Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master sql/ha_innodb.cc: Fix InnoDB bug #6287: if one uses INSERT IGNORE to insert several rows at a time, and the first inserts are ignored because of a duplicate key collision, then InnoDB in a replication slave assigns AUTO_INCREMENT values 1 bigger than in the master
-rw-r--r--sql/ha_innodb.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index d57a9f73c91..91f92c8cadb 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -2172,8 +2172,9 @@ ha_innobase::write_row(
same SQL statement! */
if (auto_inc == 0 && user_thd->next_insert_id != 0) {
- auto_inc = user_thd->next_insert_id;
- auto_inc_counter_for_this_stat = auto_inc;
+
+ auto_inc_counter_for_this_stat
+ = user_thd->next_insert_id;
}
if (auto_inc == 0 && auto_inc_counter_for_this_stat) {
@@ -2181,14 +2182,14 @@ ha_innobase::write_row(
this SQL statement with SET INSERT_ID. We must
assign sequential values from the counter. */
- auto_inc_counter_for_this_stat++;
- incremented_auto_inc_for_stat = TRUE;
-
auto_inc = auto_inc_counter_for_this_stat;
/* We give MySQL a new value to place in the
auto-inc column */
user_thd->next_insert_id = auto_inc;
+
+ auto_inc_counter_for_this_stat++;
+ incremented_auto_inc_for_stat = TRUE;
}
if (auto_inc != 0) {