1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-5743 Server crashes in mysql_alter_table on an attempt to add a primary key to InnoDB table

This commit is contained in:
Sergei Golubchik
2014-04-07 21:53:19 +02:00
parent e82a82eef8
commit 5f0c98c17b
3 changed files with 21 additions and 1 deletions

View File

@ -16,3 +16,11 @@ insert t1 values (repeat('3', 8193),3,1,1);
ALTER TABLE t1 ADD PRIMARY KEY (col4(10)) , ADD UNIQUE KEY uidx (col3);
ERROR 23000: Duplicate entry '1' for key 'uidx'
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (2);
ALTER TABLE t1 ADD PRIMARY KEY (a);
ALTER TABLE t1 DROP PRIMARY KEY;
INSERT INTO t1 VALUES (2);
ALTER TABLE t1 ADD PRIMARY KEY (a);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
DROP TABLE t1;