File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
storage/innodb_plugin/handler Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8679,6 +8679,7 @@ ha_innobase::get_auto_increment(
8679
8679
AUTOINC counter after attempting to insert the row. */
8680
8680
if (innobase_autoinc_lock_mode != AUTOINC_OLD_STYLE_LOCKING) {
8681
8681
ulonglong need;
8682
+ ulonglong current;
8682
8683
ulonglong next_value;
8683
8684
ulonglong col_max_value;
8684
8685
@@ -8687,11 +8688,12 @@ ha_innobase::get_auto_increment(
8687
8688
col_max_value = innobase_get_int_col_max_value (
8688
8689
table->next_number_field );
8689
8690
8691
+ current = *first_value > col_max_value ? autoinc : *first_value;
8690
8692
need = *nb_reserved_values * increment;
8691
8693
8692
8694
/* Compute the last value in the interval */
8693
8695
next_value = innobase_next_autoinc (
8694
- *first_value , need, offset, col_max_value);
8696
+ current , need, offset, col_max_value);
8695
8697
8696
8698
prebuilt->autoinc_last_value = next_value;
8697
8699
You can’t perform that action at this time.
0 commit comments