mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
don't increment LAST_INSERT_ID() when incremented value cannot be stored in auto_increment column (e.g. is too big)
mysql-test/r/auto_increment.result: more tests mysql-test/t/auto_increment.test: more tests
This commit is contained in:
@@ -660,8 +660,8 @@ void handler::update_auto_increment()
|
||||
thd->next_insert_id=0; // Clear after use
|
||||
else
|
||||
nr=get_auto_increment();
|
||||
thd->insert_id((ulonglong) nr);
|
||||
table->next_number_field->store(nr);
|
||||
if (!table->next_number_field->store(nr))
|
||||
thd->insert_id((ulonglong) nr);
|
||||
auto_increment_column_changed=1;
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user