summaryrefslogtreecommitdiff
path: root/mysql-test/t/auto_increment.test
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@sun.com>2009-08-20 14:30:59 +0200
committerMartin Hansson <martin.hansson@sun.com>2009-08-20 14:30:59 +0200
commitacdbef45205552ee3444f072251c7f5dc2850871 (patch)
tree4868f5a041cb941b8da9850318ed6c9c6e2f7496 /mysql-test/t/auto_increment.test
parenta6ddf8b18a0dc14c880261beb572e8128aebd55d (diff)
parente66fba53a76b54d63d7ce6edc680a2e8886018d8 (diff)
downloadmariadb-git-acdbef45205552ee3444f072251c7f5dc2850871.tar.gz
Bug#46616: Merge
mysql-test/r/auto_increment.result: Bug#46616: Test result. mysql-test/t/auto_increment.test: Bug#46616: Test case. sql/sql_update.cc: Bug#46616: Fix.
Diffstat (limited to 'mysql-test/t/auto_increment.test')
-rw-r--r--mysql-test/t/auto_increment.test18
1 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index 32f065171f2..076e32eb22c 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -324,3 +324,21 @@ insert into t1 values(null,0,0,0,null);
replace into t1 values(null,1,0,2,null);
select last_insert_id();
drop table t1;
+
+--echo #
+--echo # Bug#46616: Assertion `!table->auto_increment_field_not_null' on view
+--echo # manipulations
+--echo #
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (1);
+
+CREATE TABLE t2 ( a INT AUTO_INCREMENT KEY );
+--error ER_DUP_ENTRY
+CREATE TABLE IF NOT EXISTS t2 AS SELECT a FROM t1;
+
+UPDATE t2 SET a = 2;
+
+SELECT a FROM t2;
+
+DROP TABLE t1, t2;
+