1
0
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:
unknown
2003-03-31 23:14:26 +04:00
parent 7e13ac1242
commit 76bd917526
3 changed files with 70 additions and 2 deletions

View File

@@ -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;
}