summaryrefslogtreecommitdiff
path: root/mysql-test/t/if_exists.test
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2018-04-18 11:35:31 +0300
committerJan Lindström <jan.lindstrom@mariadb.com>2018-04-18 11:35:31 +0300
commita0817923a141650ff37d9f8358bc938556981c69 (patch)
treee5293ce937c65e5bec2843b5980ffbae9d827517 /mysql-test/t/if_exists.test
parent226ec99a3ed662bace80d70dd7fefd0db7b4af0a (diff)
downloadmariadb-git-bb-10.0-MDEV-15308.tar.gz
MDEV-15308: Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed in ha_innodb::prepare_inplace_alter_tablebb-10.0-MDEV-15308
Problem was thet when items were removed from drop_list alter_info flags were not adjusted accordingly in all cases.
Diffstat (limited to 'mysql-test/t/if_exists.test')
-rw-r--r--mysql-test/t/if_exists.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/if_exists.test b/mysql-test/t/if_exists.test
new file mode 100644
index 00000000000..420efaba150
--- /dev/null
+++ b/mysql-test/t/if_exists.test
@@ -0,0 +1,33 @@
+--source include/have_innodb.inc
+
+#
+# MDEV-15308: Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed in ha_innodb::prepare_inplace_alter_table
+#
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
+SHOW CREATE TABLE t1;
+
+# Cleanup
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
+ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
+SHOW CREATE TABLE t1;
+
+# Cleanup
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
+SHOW CREATE TABLE t1;
+
+# Cleanup
+DROP TABLE t1;
+
+CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
+ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
+SHOW CREATE TABLE t1;
+
+# Cleanup
+DROP TABLE t1;