Skip to content

Commit 493c055

Browse files
author
MySQL Build Team
committed
Patch adjustments
1 parent 597f8d5 commit 493c055

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

storage/innodb_plugin/handler/ha_innodb.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8679,6 +8679,7 @@ ha_innobase::get_auto_increment(
86798679
AUTOINC counter after attempting to insert the row. */
86808680
if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
86818681
ulonglong need;
8682+
ulonglong current;
86828683
ulonglong next_value;
86838684
ulonglong col_max_value;
86848685

@@ -8687,11 +8688,12 @@ ha_innobase::get_auto_increment(
86878688
col_max_value = innobase_get_int_col_max_value(
86888689
table->next_number_field);
86898690

8691+
current = *first_value > col_max_value ? autoinc : *first_value;
86908692
need = *nb_reserved_values * increment;
86918693

86928694
/* Compute the last value in the interval */
86938695
next_value = innobase_next_autoinc(
8694-
*first_value, need, offset, col_max_value);
8696+
current, need, offset, col_max_value);
86958697

86968698
prebuilt->autoinc_last_value = next_value;
86978699

0 commit comments

Comments
 (0)