mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix for bug#38821: Assert table->auto_increment_field_not_null failed
in open_table() Problem: repeating "CREATE... ( AUTOINCREMENT) ... SELECT" may lead to an assertion failure. Fix: reset table->auto_increment_field_not_null after each record writing. mysql-test/r/create.result: Fix for bug#38821: Assert table->auto_increment_field_not_null failed in open_table() - test result. mysql-test/t/create.test: Fix for bug#38821: Assert table->auto_increment_field_not_null failed in open_table() - test case. sql/sql_insert.cc: Fix for bug#38821: Assert table->auto_increment_field_not_null failed in open_table() - reset table->auto_increment_field_not_null after writing a record for "{CREATE, INSERT}..SELECT".
This commit is contained in:
@@ -2897,7 +2897,11 @@ bool select_insert::send_data(List<Item> &values)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
if (!(error= write_record(thd, table, &info)))
|
||||
|
||||
error= write_record(thd, table, &info);
|
||||
table->auto_increment_field_not_null= FALSE;
|
||||
|
||||
if (!error)
|
||||
{
|
||||
if (table->triggers || info.handle_duplicates == DUP_UPDATE)
|
||||
{
|
||||
|
Reference in New Issue
Block a user