1SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
2SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
3# Bug #12429576 - Test an assertion failure on purge.
4CREATE TABLE t1_purge (
5A int,
6B blob, C blob, D blob, E blob,
7F blob, G blob, H blob,
8PRIMARY KEY (B(767), C(767), D(767), E(767), A),
9INDEX (A)
10) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
11INSERT INTO t1_purge VALUES (1,
12REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
13REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
14CREATE TABLE t2_purge (
15A int PRIMARY KEY,
16B blob, C blob, D blob, E blob,
17F blob, G blob, H blob, I blob,
18J blob, K blob, L blob,
19INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
20INSERT INTO t2_purge VALUES (1,
21REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
22REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
23REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
24CREATE TABLE t3_purge (
25A int,
26B varchar(800), C varchar(800), D varchar(800), E varchar(800),
27F varchar(800), G varchar(800), H varchar(800),
28PRIMARY KEY (B(767), C(767), D(767), E(767), A),
29INDEX (A)
30) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
31INSERT INTO t3_purge SELECT * FROM t1_purge;
32CREATE TABLE t4_purge (
33A int PRIMARY KEY,
34B varchar(800), C varchar(800), D varchar(800), E varchar(800),
35F varchar(800), G varchar(800), H varchar(800), I varchar(800),
36J varchar(800), K varchar(800), L varchar(800),
37INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
38INSERT INTO t4_purge SELECT * FROM t2_purge;
39DELETE FROM t1_purge;
40DELETE FROM t2_purge;
41DELETE FROM t3_purge;
42DELETE FROM t4_purge;
43SET @r=REPEAT('a',500);
44CREATE TABLE t12637786(a int,
45v1 varchar(500), v2 varchar(500), v3 varchar(500),
46v4 varchar(500), v5 varchar(500), v6 varchar(500),
47v7 varchar(500), v8 varchar(500), v9 varchar(500),
48v10 varchar(500), v11 varchar(500), v12 varchar(500),
49v13 varchar(500), v14 varchar(500), v15 varchar(500),
50v16 varchar(500), v17 varchar(500), v18 varchar(500)
51) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
52CREATE INDEX idx1 ON t12637786(a,v1);
53INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
54UPDATE t12637786 SET a=1000;
55DELETE FROM t12637786;
56# Bug#12963823 - Test that the purge thread does not crash when
57CREATE TABLE t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
58i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
59ENGINE=innodb ROW_FORMAT=dynamic;
60SET @r = REPEAT('a', 767);
61INSERT INTO t12963823 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
62CREATE INDEX ndx_a ON t12963823 (a(500));
63CREATE INDEX ndx_b ON t12963823 (b(500));
64CREATE INDEX ndx_c ON t12963823 (c(500));
65CREATE INDEX ndx_d ON t12963823 (d(500));
66CREATE INDEX ndx_e ON t12963823 (e(500));
67CREATE INDEX ndx_f ON t12963823 (f(500));
68CREATE INDEX ndx_k ON t12963823 (k(500));
69CREATE INDEX ndx_l ON t12963823 (l(500));
70SET @r = REPEAT('b', 500);
71UPDATE t12963823 set a=@r,b=@r,c=@r,d=@r;
72UPDATE t12963823 set e=@r,f=@r,g=@r,h=@r;
73UPDATE t12963823 set i=@r,j=@r,k=@r,l=@r;
74UPDATE t12963823 set m=@r,n=@r,o=@r,p=@r;
75ALTER TABLE t12963823 DROP INDEX ndx_a;
76ALTER TABLE t12963823 DROP INDEX ndx_b;
77CREATE INDEX ndx_g ON t12963823 (g(500));
78CREATE INDEX ndx_h ON t12963823 (h(500));
79CREATE INDEX ndx_i ON t12963823 (i(500));
80CREATE INDEX ndx_j ON t12963823 (j(500));
81CREATE INDEX ndx_m ON t12963823 (m(500));
82CREATE INDEX ndx_n ON t12963823 (n(500));
83CREATE INDEX ndx_o ON t12963823 (o(500));
84CREATE INDEX ndx_p ON t12963823 (p(500));
85SHOW CREATE TABLE t12963823;
86Table	Create Table
87t12963823	CREATE TABLE `t12963823` (
88  `a` blob DEFAULT NULL,
89  `b` blob DEFAULT NULL,
90  `c` blob DEFAULT NULL,
91  `d` blob DEFAULT NULL,
92  `e` blob DEFAULT NULL,
93  `f` blob DEFAULT NULL,
94  `g` blob DEFAULT NULL,
95  `h` blob DEFAULT NULL,
96  `i` blob DEFAULT NULL,
97  `j` blob DEFAULT NULL,
98  `k` blob DEFAULT NULL,
99  `l` blob DEFAULT NULL,
100  `m` blob DEFAULT NULL,
101  `n` blob DEFAULT NULL,
102  `o` blob DEFAULT NULL,
103  `p` blob DEFAULT NULL,
104  KEY `ndx_c` (`c`(500)),
105  KEY `ndx_d` (`d`(500)),
106  KEY `ndx_e` (`e`(500)),
107  KEY `ndx_f` (`f`(500)),
108  KEY `ndx_k` (`k`(500)),
109  KEY `ndx_l` (`l`(500)),
110  KEY `ndx_g` (`g`(500)),
111  KEY `ndx_h` (`h`(500)),
112  KEY `ndx_i` (`i`(500)),
113  KEY `ndx_j` (`j`(500)),
114  KEY `ndx_m` (`m`(500)),
115  KEY `ndx_n` (`n`(500)),
116  KEY `ndx_o` (`o`(500)),
117  KEY `ndx_p` (`p`(500))
118) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
119InnoDB		0 transactions not purged
120DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge, t12637786, t12963823;
121SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
122