diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2015-06-14 18:54:13 +0500 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2015-06-14 18:54:13 +0500 |
commit | 196528eb42c843ca800b81be27a79c7c4806a057 (patch) | |
tree | 6259f3923adbff1debb02428c41c9b7be6afc877 /mysql-test/t/alter_table.test | |
parent | fc31e3114b2538d152194d17ff0f0439db565634 (diff) | |
download | mariadb-git-196528eb42c843ca800b81be27a79c7c4806a057.tar.gz |
MDEV-8212 alter table - failing to ADD PRIMARY KEY IF NOT EXISTS when existing index of same as column name.
The default name for the primary key is rather 'PRIMARY' instead of the indexed column name.
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r-- | mysql-test/t/alter_table.test | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 416c73009e6..cbb73bbb3d4 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1326,6 +1326,14 @@ SHOW CREATE TABLE t2; DROP TABLE t2; DROP TABLE t1; +CREATE TABLE t1 ( + `transaction_id` int(11) NOT NULL DEFAULT '0', + KEY `transaction_id` (`transaction_id`)); +ALTER TABLE t1 DROP KEY IF EXISTS transaction_id, ADD PRIMARY KEY IF NOT EXISTS (transaction_id); +SHOW CREATE TABLE t1; + +DROP TABLE t1; + --echo # Bug#11748057 (formerly known as 34972): ALTER TABLE statement doesn't --echo # identify correct column name. --echo # |