mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -1172,4 +1172,22 @@ SHOW INDEX FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
#
|
||||
# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
|
||||
#
|
||||
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
|
||||
INSERT IGNORE INTO t1 (b) VALUES (5);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
--error 1062
|
||||
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
|
||||
SELECT a FROM t1;
|
||||
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
||||
--echo End of 5.0 tests
|
||||
|
Reference in New Issue
Block a user