summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/innodb-alter-debug.result
blob: 8962d6ba400cec73d8283021f7e591cca674522e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
SET NAMES utf8;
CREATE TABLE ① (
c1 INT PRIMARY KEY, c2 INT DEFAULT 1, ct TEXT, INDEX(c2))
ENGINE = InnoDB;
CREATE TABLE t1ć (c1 INT PRIMARY KEY, c2 INT, INDEX(c2),
CONSTRAINT t1c2 FOREIGN KEY (c2) REFERENCES ①(c2))
ENGINE=InnoDB;
INSERT INTO ① SET c1 = 1;
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET DEBUG_DBUG = '+d,ib_drop_foreign_error';
ALTER TABLE t1ć DROP FOREIGN KEY t1c2, RENAME TO ②;
ERROR HY000: The table 't1ć' is full
SET DEBUG_DBUG = @saved_debug_dbug;
SET DEBUG_DBUG = '+d,ib_rename_column_error';
ALTER TABLE ① CHANGE c2 š INT;
ERROR HY000: The table '①' is full
SET DEBUG_DBUG = @saved_debug_dbug;
SHOW CREATE TABLE t1ć;
Table	Create Table
t1ć	CREATE TABLE `t1ć` (
  `c1` int(11) NOT NULL,
  `c2` int(11) DEFAULT NULL,
  PRIMARY KEY (`c1`),
  KEY `c2` (`c2`),
  CONSTRAINT `t1c2` FOREIGN KEY (`c2`) REFERENCES `①` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1ć, ①;
#
# Bug #21364096  THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
#                WITH INCORRECT KEY NAME
create table t1 (id int auto_increment primary key, a int, unique key uk(a))
engine = innodb;
insert into t1 select 1, 1;
insert into t1 select 2, 2;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
alter table t1 force, add b int, ALGORITHM=inplace;
/* connection con1 */
connect  con1,localhost,root,,;
SET DEBUG_SYNC = 'now WAIT_FOR s1';
insert into t1 select NULL, 1;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'now SIGNAL s2';
/* connection default */
connection default;
/* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL s1 WAIT_FOR s2';
alter table t1 force, add c int, ALGORITHM=inplace;;
/* connection con1 */
connection con1;
set DEBUG_SYNC = 'now WAIT_FOR s1';
update t1 set a=1 where id=2;
ERROR 23000: Duplicate entry '1' for key 'uk'
SET DEBUG_SYNC = 'now SIGNAL s2';
/* connection default */
connection default;
/* reap */ alter table t1 force, add b int, ALGORITHM=inplace;
SET DEBUG_SYNC = 'RESET';
drop table t1;
#
# Bug #27753193  ASSERTION `PREBUILT->TRX->ERROR_KEY_NUM <
#                HA_ALTER_INFO->KEY_COUNT'
CREATE TABLE t1 (a INT, UNIQUE KEY(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET DEBUG_SYNC = 'row_log_table_apply1_before signal S1 WAIT_FOR S2';
ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
connection con1;
SET DEBUG_SYNC = 'now WAIT_FOR S1';
INSERT INTO t1 VALUES (1);
ERROR 23000: Duplicate entry '1' for key 'a'
SET DEBUG_SYNC = 'now SIGNAL S2';
disconnect con1;
connection default;
SET DEBUG_SYNC='RESET';
DROP TABLE t1;
#
# MDEV-17470 Orphan temporary files after interrupted ALTER
# cause InnoDB: Operating system error number 17 and eventual
# fatal error 71
#
CREATE TABLE t1 (pk INT AUTO_INCREMENT PRIMARY KEY, i INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL,1),(NULL,2),(NULL,3),(NULL,4),(NULL,5),(NULL,6),(NULL,7),(NULL,8);
INSERT INTO t1 SELECT NULL, i FROM t1;
INSERT INTO t1 SELECT NULL, i FROM t1;
INSERT INTO t1 SELECT NULL, i FROM t1;
INSERT INTO t1 SELECT NULL, i FROM t1;
INSERT INTO t1 SELECT NULL, i FROM t1;
LOCK TABLE t1 READ;
connect  con1,localhost,root,,test;
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
connection default;
kill query @id;
connection con1;
ERROR 70100: Query execution was interrupted
disconnect con1;
connection default;
UNLOCK TABLES;
DROP TABLE t1;
#
# MDEV-7318 RENAME INDEX
#
CREATE TABLE t (c1 INT, c2 INT, KEY i2 (c2)) ENGINE=INNODB;
SET DEBUG_DBUG= '+d,ib_rename_index_fail1';
ALTER TABLE t RENAME INDEX i2 to x, ALGORITHM=INPLACE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET DEBUG_DBUG = @saved_debug_dbug;
DROP TABLE t;
#
# MDEV-26772 InnoDB DDL fails with DUPLICATE KEY error
#
create table t1(f1 int not null primary key,
f2 int not null, index idx(f2))engine=innodb;
insert into t1 values(1, 1);
connect con1,localhost,root,,,;
SET DEBUG_SYNC='before_delete_table_stats SIGNAL blocked WAIT_FOR go';
SET innodb_lock_wait_timeout=0;
ALTER TABLE t1 FORCE, ALGORITHM=COPY;
connection default;
SET DEBUG_SYNC='now WAIT_FOR blocked';
BEGIN;
SELECT * FROM mysql.innodb_table_stats FOR UPDATE;
database_name	table_name	last_update	n_rows	clustered_index_size	sum_of_other_index_sizes
SET DEBUG_SYNC='now SIGNAL go';
connection con1;
connection default;
COMMIT;
SET DEBUG_SYNC=RESET;
connection con1;
ALTER TABLE t1 RENAME KEY idx TO idx1, ALGORITHM=COPY;
disconnect con1;
connection default;
DROP TABLE t1;
#
# MDEV-26903 Assertion ctx->trx->state == TRX_STATE_ACTIVE on DROP INDEX
#
CREATE TABLE t1(a INT PRIMARY KEY, b INT, INDEX(b)) ENGINE=InnoDB;
SET @save_dbug=@@debug_dbug;
SET debug_dbug='+d,deadlock_table_fail';
ALTER TABLE t1 DROP INDEX b, ALGORITHM=INPLACE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET debug_dbug=@save_dbug;
DROP TABLE t1;
# End of 10.6 tests