summaryrefslogtreecommitdiff
path: root/mysql-test/main/check.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-05-24 11:27:15 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-05-24 11:27:15 +0300
commit6686dfcbbf74159a47cb1b3ffd36daed8a2fa420 (patch)
tree731e2288bfe7a903671a011d55c9de1ba863d779 /mysql-test/main/check.test
parenta80e41043876b486d94a641e98ce2e6057c0a65e (diff)
parent52df8040264cc6f3226e78d371e4c1dd88dd22b6 (diff)
downloadmariadb-git-6686dfcbbf74159a47cb1b3ffd36daed8a2fa420.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/check.test')
-rw-r--r--mysql-test/main/check.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/main/check.test b/mysql-test/main/check.test
index 6a7b7253a59..cce8fd34c9c 100644
--- a/mysql-test/main/check.test
+++ b/mysql-test/main/check.test
@@ -79,3 +79,27 @@ disconnect con1;
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
+
+--echo #
+--echo # MDEV-15338
+--echo # Assertion `!table || (!table->read_set ||
+--echo # bitmap_is_set(table->read_set, field_index))'
+--echo # failed on dropping column with CHECK
+--echo #
+
+CREATE TABLE t1 (a INT, b INT, CHECK (a>0)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (1,2),(3,4);
+ALTER TABLE t1 DROP COLUMN a;
+CREATE OR REPLACE TABLE t1 (a INT, b INT, CHECK (a>0)) ENGINE=MyISAM;
+ALTER TABLE t1 DROP COLUMN b;
+CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
+--error ER_BAD_FIELD_ERROR
+ALTER TABLE t1 DROP COLUMN b;
+ALTER TABLE t1 DROP COLUMN a, DROP COLUMN b;
+CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
+ALTER TABLE t1 DROP CONSTRAINT `CONSTRAINT_1`;
+SHOW CREATE TABLE t1;
+CREATE OR REPLACE TABLE t1 (a INT, b INT, c INT, CHECK (a+b>0)) ENGINE=MyISAM;
+ALTER TABLE t1 DROP COLUMN b, DROP CONSTRAINT `CONSTRAINT_1`;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;