| 1 |
SET NAMES utf8; |
| 2 |
Warnings: |
| 3 |
Warning 3719 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
| 4 |
CREATE TABLE ① ( |
| 5 |
c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT, INDEX(c2)) |
| 6 |
ENGINE = InnoDB; |
| 7 |
CREATE TABLE t1ć (c1 INT PRIMARY KEY, c2 INT, INDEX(c2), |
| 8 |
CONSTRAINT t1c2 FOREIGN KEY (c2) REFERENCES ①(c2)) |
| 9 |
ENGINE=InnoDB; |
| 10 |
INSERT INTO ① SET c1 = 1; |
| 11 |
SET DEBUG = '+d,ib_drop_foreign_error'; |
| 12 |
ALTER TABLE t1ć DROP FOREIGN KEY t1c2, RENAME TO ②; |
| 13 |
ERROR HY000: The table 't1ć' is full |
| 14 |
SET DEBUG = '-d,ib_drop_foreign_error'; |
| 15 |
SET DEBUG = '+d,ib_rename_column_error'; |
| 16 |
ALTER TABLE ① CHANGE c2 š INT; |
| 17 |
ERROR HY000: The table '①' is full |
| 18 |
SET DEBUG = '-d,ib_rename_column_error'; |
| 19 |
SHOW CREATE TABLE t1ć; |
| 20 |
Table Create Table |
| 21 |
t1ć CREATE TABLE `t1ć` ( |
| 22 |
`c1` int NOT NULL, |
| 23 |
`c2` int DEFAULT NULL, |
| 24 |
PRIMARY KEY (`c1`), |
| 25 |
KEY `c2` (`c2`), |
| 26 |
CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `①` (`c2`) |
| 27 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 28 |
DROP TABLE t1ć, ①; |
| 29 |
# |
| 30 |
# Bug #21364096 THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL |
| 31 |
# WITH INCORRECT KEY NAME |
| 32 |
create table t1 (id int auto_increment primary key, |
| 33 |
a int, |
| 34 |
unique key uk(a))engine=innodb; |
| 35 |
insert into t1 select 1, 1; |
| 36 |
insert into t1 select 2, 2; |
| 37 |
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2'; |
| 38 |
alter table t1 add b int, ALGORITHM=inplace; |
| 39 |
/* connection con1 */ |
| 40 |
SET DEBUG_SYNC = 'now WAIT_FOR s1'; |
| 41 |
insert into t1 select NULL, 1; |
| 42 |
ERROR 23000: Duplicate entry '1' for key 't1.uk' |
| 43 |
SET DEBUG_SYNC = 'now SIGNAL s2'; |
| 44 |
/* connection default */ |
| 45 |
/* reap */ alter table t1 add b int, ALGORITHM=inplace; |
| 46 |
ERROR 23000: Duplicate entry '1' for key 't1.uk' |
| 47 |
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2'; |
| 48 |
alter table t1 add b int, ALGORITHM=inplace;; |
| 49 |
/* connection con1 */ |
| 50 |
set DEBUG_SYNC = 'now WAIT_FOR s1'; |
| 51 |
update t1 set a=1 where id=2; |
| 52 |
ERROR 23000: Duplicate entry '1' for key 't1.uk' |
| 53 |
SET DEBUG_SYNC = 'now SIGNAL s2'; |
| 54 |
/* connection default */ |
| 55 |
/* reap */ alter table t1 add b int, ALGORITHM=inplace; |
| 56 |
ERROR 23000: Duplicate entry '1' for key 't1.uk' |
| 57 |
drop table t1; |
| 58 |
# |
| 59 |
# Bug #27753193 ASSERTION `PREBUILT->TRX->ERROR_KEY_NUM < |
| 60 |
# HA_ALTER_INFO->KEY_COUNT' |
| 61 |
CREATE TABLE t1 (a INT, UNIQUE KEY(a)) ENGINE = INNODB; |
| 62 |
INSERT INTO t1 VALUES (1); |
| 63 |
SET DEBUG_SYNC = 'row_log_table_apply1_before signal S1 WAIT_FOR S2'; |
| 64 |
OPTIMIZE TABLE t1;; |
| 65 |
SET DEBUG_SYNC = 'now WAIT_FOR S1'; |
| 66 |
INSERT INTO t1 VALUES (1); |
| 67 |
ERROR 23000: Duplicate entry '1' for key 't1.a' |
| 68 |
SET DEBUG_SYNC = 'now SIGNAL S2'; |
| 69 |
/* reap */ OPTIMIZE TABLE t1; |
| 70 |
Table Op Msg_type Msg_text |
| 71 |
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead |
| 72 |
test.t1 optimize error Duplicate entry '1' for key 't1.a' |
| 73 |
test.t1 optimize status Operation failed |
| 74 |
Warnings: |
| 75 |
Error 1062 Duplicate entry '1' for key 't1.a' |
| 76 |
SET DEBUG_SYNC='RESET'; |
| 77 |
DROP TABLE t1; |