mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
merged
This commit is contained in:
commit
f3190ea61f
10 changed files with 154 additions and 2 deletions
|
|
@ -6455,9 +6455,22 @@ void ha_partition::release_auto_increment()
|
|||
ulonglong next_auto_inc_val;
|
||||
lock_auto_increment();
|
||||
next_auto_inc_val= ha_data->next_auto_inc_val;
|
||||
/*
|
||||
If the current auto_increment values is lower than the reserved
|
||||
value, and the reserved value was reserved by this thread,
|
||||
we can lower the reserved value.
|
||||
*/
|
||||
if (next_insert_id < next_auto_inc_val &&
|
||||
auto_inc_interval_for_cur_row.maximum() >= next_auto_inc_val)
|
||||
ha_data->next_auto_inc_val= next_insert_id;
|
||||
{
|
||||
THD *thd= ha_thd();
|
||||
/*
|
||||
Check that we do not lower the value because of a failed insert
|
||||
with SET INSERT_ID, i.e. forced/non generated values.
|
||||
*/
|
||||
if (thd->auto_inc_intervals_forced.maximum() < next_insert_id)
|
||||
ha_data->next_auto_inc_val= next_insert_id;
|
||||
}
|
||||
DBUG_PRINT("info", ("ha_data->next_auto_inc_val: %lu",
|
||||
(ulong) ha_data->next_auto_inc_val));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue