Commit a12fb5d0 authored by Marko Mäkelä's avatar Marko Mäkelä

Replace innodb_zip.16k with innodb_zip.page_size

Also, move part of the test back to innodb.innodb_mysql
and another part to a new test innodb.purge.

Last but not least, merge the tests innodb_zip.4k and innodb_zip.8k
to innodb_zip.page_size.
parent 6ffaed61
......@@ -3134,8 +3134,49 @@ ERROR 22007: Incorrect datetime value: ''
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
#
# Bug#56862 Moved to innodb_16k.test
# Bug#56862 Execution of a query that uses index merge returns a wrong result
#
CREATE TABLE t1 (
pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
a int,
b int,
INDEX idx(a))
ENGINE=INNODB;
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
set @optimizer_switch_saved=@@optimizer_switch;
SET SESSION optimizer_switch='derived_merge=off';
SET SESSION sort_buffer_size = 1024*36;
EXPLAIN
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 1537
2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 1537 Using sort_union(idx,PRIMARY); Using where
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
COUNT(*)
1537
set @@optimizer_switch=@optimizer_switch_saved;
SET SESSION sort_buffer_size = DEFAULT;
DROP TABLE t1;
#
# Test for bug #39932 "create table fails if column for FK is in different
# case than in corr index".
......
SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
# Bug #12429576 - Test an assertion failure on purge.
CREATE TABLE t1_purge (
A int,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob,
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
CREATE TABLE t2_purge (
A int PRIMARY KEY,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob, I blob,
J blob, K blob, L blob,
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t2_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
CREATE TABLE t3_purge (
A int,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800),
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t3_purge SELECT * FROM t1_purge;
CREATE TABLE t4_purge (
A int PRIMARY KEY,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800), I varchar(800),
J varchar(800), K varchar(800), L varchar(800),
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t4_purge SELECT * FROM t2_purge;
DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a int,
v1 varchar(500), v2 varchar(500), v3 varchar(500),
v4 varchar(500), v5 varchar(500), v6 varchar(500),
v7 varchar(500), v8 varchar(500), v9 varchar(500),
v10 varchar(500), v11 varchar(500), v12 varchar(500),
v13 varchar(500), v14 varchar(500), v15 varchar(500),
v16 varchar(500), v17 varchar(500), v18 varchar(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
# Bug#12963823 - Test that the purge thread does not crash when
CREATE TABLE t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
ENGINE=innodb ROW_FORMAT=dynamic;
SET @r = REPEAT('a', 767);
INSERT INTO t12963823 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
CREATE INDEX ndx_a ON t12963823 (a(500));
CREATE INDEX ndx_b ON t12963823 (b(500));
CREATE INDEX ndx_c ON t12963823 (c(500));
CREATE INDEX ndx_d ON t12963823 (d(500));
CREATE INDEX ndx_e ON t12963823 (e(500));
CREATE INDEX ndx_f ON t12963823 (f(500));
CREATE INDEX ndx_k ON t12963823 (k(500));
CREATE INDEX ndx_l ON t12963823 (l(500));
SET @r = REPEAT('b', 500);
UPDATE t12963823 set a=@r,b=@r,c=@r,d=@r;
UPDATE t12963823 set e=@r,f=@r,g=@r,h=@r;
UPDATE t12963823 set i=@r,j=@r,k=@r,l=@r;
UPDATE t12963823 set m=@r,n=@r,o=@r,p=@r;
ALTER TABLE t12963823 DROP INDEX ndx_a;
ALTER TABLE t12963823 DROP INDEX ndx_b;
CREATE INDEX ndx_g ON t12963823 (g(500));
CREATE INDEX ndx_h ON t12963823 (h(500));
CREATE INDEX ndx_i ON t12963823 (i(500));
CREATE INDEX ndx_j ON t12963823 (j(500));
CREATE INDEX ndx_m ON t12963823 (m(500));
CREATE INDEX ndx_n ON t12963823 (n(500));
CREATE INDEX ndx_o ON t12963823 (o(500));
CREATE INDEX ndx_p ON t12963823 (p(500));
SHOW CREATE TABLE t12963823;
Table Create Table
t12963823 CREATE TABLE `t12963823` (
`a` blob DEFAULT NULL,
`b` blob DEFAULT NULL,
`c` blob DEFAULT NULL,
`d` blob DEFAULT NULL,
`e` blob DEFAULT NULL,
`f` blob DEFAULT NULL,
`g` blob DEFAULT NULL,
`h` blob DEFAULT NULL,
`i` blob DEFAULT NULL,
`j` blob DEFAULT NULL,
`k` blob DEFAULT NULL,
`l` blob DEFAULT NULL,
`m` blob DEFAULT NULL,
`n` blob DEFAULT NULL,
`o` blob DEFAULT NULL,
`p` blob DEFAULT NULL,
KEY `ndx_c` (`c`(500)),
KEY `ndx_d` (`d`(500)),
KEY `ndx_e` (`e`(500)),
KEY `ndx_f` (`f`(500)),
KEY `ndx_k` (`k`(500)),
KEY `ndx_l` (`l`(500)),
KEY `ndx_g` (`g`(500)),
KEY `ndx_h` (`h`(500)),
KEY `ndx_i` (`i`(500)),
KEY `ndx_j` (`j`(500)),
KEY `ndx_m` (`m`(500)),
KEY `ndx_n` (`n`(500)),
KEY `ndx_o` (`o`(500)),
KEY `ndx_p` (`p`(500))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
InnoDB 0 transactions not purged
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge, t12637786, t12963823;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
......@@ -818,8 +818,52 @@ DROP TABLE t1;
SET SQL_MODE=DEFAULT;
--echo #
--echo # Bug#56862 Moved to innodb_16k.test
--echo # Bug#56862 Execution of a query that uses index merge returns a wrong result
--echo #
CREATE TABLE t1 (
pk int NOT NULL AUTO_INCREMENT PRIMARY KEY,
a int,
b int,
INDEX idx(a))
ENGINE=INNODB;
INSERT INTO t1(a,b) VALUES
(11, 1100), (2, 200), (1, 100), (14, 1400), (5, 500),
(3, 300), (17, 1700), (4, 400), (12, 1200), (8, 800),
(6, 600), (18, 1800), (9, 900), (10, 1000), (7, 700),
(13, 1300), (15, 1500), (19, 1900), (16, 1600), (20, 2000);
INSERT INTO t1(a,b) SELECT a+20, b+2000 FROM t1;
INSERT INTO t1(a,b) SELECT a+40, b+4000 FROM t1;
INSERT INTO t1(a,b) SELECT a+80, b+8000 FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1(a,b) SELECT a,b FROM t1;
INSERT INTO t1 VALUES (1000000, 0, 0);
set @optimizer_switch_saved=@@optimizer_switch;
SET SESSION optimizer_switch='derived_merge=off';
SET SESSION sort_buffer_size = 1024*36;
EXPLAIN
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
SELECT COUNT(*) FROM
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
set @@optimizer_switch=@optimizer_switch_saved;
SET SESSION sort_buffer_size = DEFAULT;
DROP TABLE t1;
--echo #
--echo # Test for bug #39932 "create table fails if column for FK is in different
--echo # case than in corr index".
......
--source include/have_innodb.inc
--source include/have_innodb_16k.inc
SET @save_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
--echo # Bug #12429576 - Test an assertion failure on purge.
CREATE TABLE t1_purge (
A int,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob,
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
CREATE TABLE t2_purge (
A int PRIMARY KEY,
B blob, C blob, D blob, E blob,
F blob, G blob, H blob, I blob,
J blob, K blob, L blob,
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t2_purge VALUES (1,
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
CREATE TABLE t3_purge (
A int,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800),
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
INDEX (A)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t3_purge SELECT * FROM t1_purge;
CREATE TABLE t4_purge (
A int PRIMARY KEY,
B varchar(800), C varchar(800), D varchar(800), E varchar(800),
F varchar(800), G varchar(800), H varchar(800), I varchar(800),
J varchar(800), K varchar(800), L varchar(800),
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t4_purge SELECT * FROM t2_purge;
# This would trigger the failure (Bug #12429576)
# if purge gets a chance to run before DROP TABLE t1_purge, ....
DELETE FROM t1_purge;
DELETE FROM t2_purge;
DELETE FROM t3_purge;
DELETE FROM t4_purge;
# We need to activate the purge thread before DROP TABLE.
# Bug#12637786 - Assertion hit; ut_ad(dict_index_is_clust(index));
# A secondary index tuple is found to be too long to fit into a page.
# This test is not in innodb_8k or innodb_4k since the bug is not about
# page size. It just tests the condition that caused the assertion.
SET @r=REPEAT('a',500);
CREATE TABLE t12637786(a int,
v1 varchar(500), v2 varchar(500), v3 varchar(500),
v4 varchar(500), v5 varchar(500), v6 varchar(500),
v7 varchar(500), v8 varchar(500), v9 varchar(500),
v10 varchar(500), v11 varchar(500), v12 varchar(500),
v13 varchar(500), v14 varchar(500), v15 varchar(500),
v16 varchar(500), v17 varchar(500), v18 varchar(500)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
CREATE INDEX idx1 ON t12637786(a,v1);
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
UPDATE t12637786 SET a=1000;
DELETE FROM t12637786;
# We need to activate the purge thread before DROP TABLE
# to make sure it is able to clean up the old versions.
--echo # Bug#12963823 - Test that the purge thread does not crash when
# the number of indexes has changed since the UNDO record was logged.
# This test is not in innodb_8k or innodb_4k since the bug is not about
# page size. It just tests the condition that caused the crash.
CREATE TABLE t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
ENGINE=innodb ROW_FORMAT=dynamic;
SET @r = REPEAT('a', 767);
INSERT INTO t12963823 VALUES (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
CREATE INDEX ndx_a ON t12963823 (a(500));
CREATE INDEX ndx_b ON t12963823 (b(500));
CREATE INDEX ndx_c ON t12963823 (c(500));
CREATE INDEX ndx_d ON t12963823 (d(500));
CREATE INDEX ndx_e ON t12963823 (e(500));
CREATE INDEX ndx_f ON t12963823 (f(500));
CREATE INDEX ndx_k ON t12963823 (k(500));
CREATE INDEX ndx_l ON t12963823 (l(500));
SET @r = REPEAT('b', 500);
UPDATE t12963823 set a=@r,b=@r,c=@r,d=@r;
UPDATE t12963823 set e=@r,f=@r,g=@r,h=@r;
UPDATE t12963823 set i=@r,j=@r,k=@r,l=@r;
UPDATE t12963823 set m=@r,n=@r,o=@r,p=@r;
ALTER TABLE t12963823 DROP INDEX ndx_a;
ALTER TABLE t12963823 DROP INDEX ndx_b;
CREATE INDEX ndx_g ON t12963823 (g(500));
CREATE INDEX ndx_h ON t12963823 (h(500));
CREATE INDEX ndx_i ON t12963823 (i(500));
CREATE INDEX ndx_j ON t12963823 (j(500));
CREATE INDEX ndx_m ON t12963823 (m(500));
CREATE INDEX ndx_n ON t12963823 (n(500));
CREATE INDEX ndx_o ON t12963823 (o(500));
CREATE INDEX ndx_p ON t12963823 (p(500));
SHOW CREATE TABLE t12963823;
# We need to activate the purge thread before DROP TABLE.
-- source include/wait_all_purged.inc
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge, t12637786, t12963823;
SET GLOBAL innodb_purge_rseg_truncate_frequency=@save_frequency;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--loose-innodb-sys-indexes
--loose-innodb-sys-tablespaces
--loose-innodb-sys-datafiles
This diff is collapsed.
--loose-innodb-sys-indexes
--loose-innodb-sys-tablespaces
--loose-innodb-sys-datafiles
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment