summaryrefslogtreecommitdiff
path: root/mysql-test/t/create.test
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-09-03 15:17:19 +0500
committerRamil Kalimullin <ramil@mysql.com>2008-09-03 15:17:19 +0500
commitef13c12c0a6afc1f9c5c327a210ebe7ba464471c (patch)
tree08bc35454926b84d4309eaa63e52c470e147bb74 /mysql-test/t/create.test
parent0e3bc47fb4c4184c2a749563c131156bbddc876b (diff)
downloadmariadb-git-ef13c12c0a6afc1f9c5c327a210ebe7ba464471c.tar.gz
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.
Diffstat (limited to 'mysql-test/t/create.test')
-rw-r--r--mysql-test/t/create.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 97a7ea71b29..61ee40477ee 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -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