summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r/instant_alter_crash.result
blob: d9e57b397f3f151ed71a2e8af9a4297d3c5c4076 (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
FLUSH TABLES;
#
# MDEV-11369: Instant ADD COLUMN for InnoDB
#
CREATE TABLE t1(id INT PRIMARY KEY, c2 INT UNIQUE)
ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
CREATE TABLE t2 LIKE t1;
INSERT INTO t1 VALUES(1,2);
BEGIN;
INSERT INTO t2 VALUES(2,1);
ALTER TABLE t2 ADD COLUMN (c3 TEXT NOT NULL DEFAULT 'De finibus bonorum');
connect ddl, localhost, root;
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
ALTER TABLE t1 ADD COLUMN (c3 TEXT NOT NULL DEFAULT ' et malorum');
connection default;
SET DEBUG_SYNC='now WAIT_FOR ddl';
SET GLOBAL innodb_flush_log_at_trx_commit=1;
COMMIT;
# Kill the server
disconnect ddl;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
SELECT * FROM t1;
id	c2
1	2
SELECT * FROM t2;
id	c2	c3
2	1	De finibus bonorum
BEGIN;
DELETE FROM t1;
ROLLBACK;
InnoDB		0 transactions not purged
INSERT INTO t2 VALUES (64,42,'De finibus bonorum'), (347,33101,' et malorum');
connect ddl, localhost, root;
SET DEBUG_SYNC='innodb_alter_inplace_before_commit SIGNAL ddl WAIT_FOR ever';
ALTER TABLE t2 ADD COLUMN (c4 TEXT NOT NULL DEFAULT ' et malorum');
connection default;
SET DEBUG_SYNC='now WAIT_FOR ddl';
SET GLOBAL innodb_flush_log_at_trx_commit=1;
DELETE FROM t1;
# Kill the server
disconnect ddl;
SET @saved_frequency= @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
SELECT * FROM t1;
id	c2
SELECT * FROM t2;
id	c2	c3
2	1	De finibus bonorum
64	42	De finibus bonorum
347	33101	 et malorum
BEGIN;
INSERT INTO t1 SET id=1;
DELETE FROM t2;
ROLLBACK;
InnoDB		0 transactions not purged
FLUSH TABLE t1,t2 FOR EXPORT;
t1 clustered index root page(type 17855):
N_RECS=0; LEVEL=0
header=0x010000030074 (id=0x696e66696d756d00)
header=0x010008030000 (id=0x73757072656d756d00)
t2 clustered index root page(type 18):
N_RECS=4; LEVEL=0
header=0x010000030088 (id=0x696e66696d756d00)
header=0x1000100b00b9 (id=0x80000000,
 DB_TRX_ID=0x000000000000,
 DB_ROLL_PTR=0x80000000000000,
 c2=NULL(4 bytes),
 c3=0x44652066696e6962757320626f6e6f72756d)
header=0x0000180900d8 (id=0x80000002,
 DB_TRX_ID=0x000000000000,
 DB_ROLL_PTR=0x80000000000000,
 c2=0x80000001)
header=0x0000200900f8 (id=0x80000040,
 DB_TRX_ID=0x000000000000,
 DB_ROLL_PTR=0x80000000000000,
 c2=0x8000002a)
header=0x0000280b0074 (id=0x8000015b,
 DB_TRX_ID=0x000000000000,
 DB_ROLL_PTR=0x80000000000000,
 c2=0x8000814d,
 c3=0x206574206d616c6f72756d)
header=0x050008030000 (id=0x73757072656d756d00)
UNLOCK TABLES;
DELETE FROM t2;
InnoDB		0 transactions not purged
SHOW CREATE TABLE t1;
Table	Create Table
t1	CREATE TABLE `t1` (
  `id` int(11) NOT NULL,
  `c2` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `c2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
SHOW CREATE TABLE t2;
Table	Create Table
t2	CREATE TABLE `t2` (
  `id` int(11) NOT NULL,
  `c2` int(11) DEFAULT NULL,
  `c3` text NOT NULL DEFAULT 'De finibus bonorum',
  PRIMARY KEY (`id`),
  UNIQUE KEY `c2` (`c2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
DROP TABLE t1,t2;
db.opt
SET GLOBAL innodb_purge_rseg_truncate_frequency=@saved_frequency;