summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2015-10-25 22:45:48 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2015-10-25 22:45:48 +0400
commitc9185225cba8bb6a2a6745d98a168efe6dfaddcd (patch)
tree036d3f9f8464fafa5ac939cce5ca2cdff1360f10 /mysql-test/t/alter_table.test
parent2c0bcfff8c8e32a9b70d1090ab34a5f53182ad52 (diff)
downloadmariadb-git-c9185225cba8bb6a2a6745d98a168efe6dfaddcd.tar.gz
MDEV-8358 ALTER TABLE .. ADD PRIMARY KEY IF NOT EXISTS -> ERROR 1068 (42000): Multiple primary key defined
Checks for multiple primary keys added.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 4dde3ed6971..05d915ec478 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1699,3 +1699,16 @@ alter table t1 add unique index if not exists idx(i);
alter table t1 add unique index if not exists idx(i);
show create table t1;
DROP TABLE t1;
+
+#
+# MDEV-8358 ADD PRIMARY KEY IF NOT EXISTS -> ERROR 1068 (42000): Multiple primary key
+#
+
+CREATE TABLE t1 (
+ `event_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+ `market_id` bigint(20) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`event_id`,`market_id`)
+ );
+ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
+DROP TABLE t1;
+