Debian Codegraph @

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

raw
1 --source include/have_innodb.inc
2 --source include/have_debug.inc
3 --source include/have_partition.inc
4
5 CREATE TABLE t1(a INT PRIMARY KEY, b INT, KEY(b)) ENGINE=InnoDB
6 ROW_FORMAT=REDUNDANT PARTITION BY KEY() PARTITIONS 3;
7 INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5);
8 SET @saved_dbug= @@SESSION.debug_dbug;
9 SET DEBUG_DBUG='+d,ib_commit_inplace_fail_2';
10 --error ER_INTERNAL_ERROR
11 ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
12 SET DEBUG_DBUG= @saved_dbug;
13 CHECK TABLE t1;
14 BEGIN;
15 UPDATE t1 SET b=a+1;
16 INSERT INTO t1 VALUES (0,1);
17 ROLLBACK;
18 SELECT * FROM t1;
19 ALTER TABLE t1 ADD COLUMN c CHAR(3) DEFAULT 'lie';
20 SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
21 --error ER_INTERNAL_ERROR
22 ALTER TABLE t1 ADD COLUMN d INT NOT NULL DEFAULT -42;
23 SET DEBUG_DBUG= @saved_dbug;
24 CHECK TABLE t1;
25 BEGIN;
26 DELETE FROM t1;
27 INSERT INTO t1 VALUES (1,2,'foo');
28 ROLLBACK;
29
30 SHOW CREATE TABLE t1;
31 DROP TABLE t1;
32
33 CREATE TABLE t2(a INT, KEY(a)) ENGINE=InnoDB;
34 INSERT INTO t2 VALUES (1);
35 SET DEBUG_DBUG='+d,ib_commit_inplace_fail_1';
36 --error ER_INTERNAL_ERROR
37 ALTER TABLE t2 ADD COLUMN b INT;
38 SET DEBUG_DBUG= @saved_dbug;
39 CHECK TABLE t2;
40 BEGIN;
41 DELETE FROM t2;
42 INSERT INTO t2 VALUES (1);
43 ROLLBACK;
44
45 SHOW CREATE TABLE t2;
46 DROP TABLE t2;