Debian Codegraph @

mysql-test/suite/innodb/t/innodb-bug14219515.test

raw
1 # ==== Purpose ====
2 #
3 # Verify that ADD PRIMARY KEY can report duplicate key value
4 #
5 # ==== References ====
6 #
7 # Bug #14219515 DUPLICATE VALUE NOT REPORTED FOR ADD PRIMARY KEY
8 #
9
10 --disable_warnings
11 DROP TABLE IF EXISTS t1;
12 --enable_warnings
13
14 CREATE TABLE t1(a INT NOT NULL, b INT) ENGINE = INNODB;
15 INSERT INTO t1 VALUES (1,1),(1,2),(1,3),(1,4);
16 --ERROR ER_DUP_ENTRY
17 ALTER TABLE t1 ADD PRIMARY KEY(b), ADD UNIQUE INDEX(a);
18 DROP TABLE t1;