mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-11548 Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS.
Have to use 'keyname' to check the name uniqueness.
This commit is contained in:
@ -2076,3 +2076,18 @@ tab1 CREATE TABLE `tab1` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE `tab1`;
|
||||
#
|
||||
# MDEV-11548 Reproducible server crash after the 2nd ALTER TABLE ADD FOREIGN KEY IF NOT EXISTS
|
||||
#
|
||||
CREATE TABLE t1 (id INT UNSIGNED NOT NULL PRIMARY KEY);
|
||||
CREATE TABLE t2 (id1 INT UNSIGNED NOT NULL);
|
||||
ALTER TABLE t2
|
||||
ADD FOREIGN KEY IF NOT EXISTS (id1)
|
||||
REFERENCES t1 (id);
|
||||
ALTER TABLE t2
|
||||
ADD FOREIGN KEY IF NOT EXISTS (id1)
|
||||
REFERENCES t1 (id);
|
||||
Warnings:
|
||||
Note 1061 Duplicate key name 'id1'
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t1;
|
||||
|
Reference in New Issue
Block a user