Commit 2928e930 authored by marko's avatar marko

Merge a change from MySQL AB:

ChangeSet@1.2528.116.42  2007-09-08 20:26:12-07:00  antony@xiphis.org

Bug#30919
  "Rows not deleted from innodb partitioned tables if
  --innodb_autoinc_lock_mode=0"

  Due to a previous bugfix which initializes a previously uninitialized
  variable, ha_partition::get_auto_increment() may fail to operate
  correctly when the storage engine reports that it is only reserving
  one value and one or more partitions have a different 'next-value'.
  Currently, only affects Innodb's new-style auto-increment code which
  reserves larger blocks of values and has less inter-thread contention.

ha_innodb.cc:
Bug30919
  Only set *first_value if it is less than autoinc value. This allows
  a higher value to be hinted when operating as a partitioned table.
parent 7acad9f3
......@@ -7367,10 +7367,10 @@ ha_innobase::get_auto_increment(
trx->n_autoinc_rows = 1;
}
*first_value = autoinc;
set_if_bigger(*first_value, autoinc);
/* Not in the middle of a mult-row INSERT. */
} else if (prebuilt->last_value == 0) {
*first_value = autoinc;
set_if_bigger(*first_value, autoinc);
}
*nb_reserved_values = trx->n_autoinc_rows;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment