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

MDEV-21549: Clean up the import/export tests

Remove CREATE/DROP database.

Remove some unnecessary suppressions, replacements, and
SQL statements.

Populate tables via have_sequence.inc to avoid the creation of
explicit InnoDB record locks in INSERT...SELECT. This will remove
some gaps in AUTO_INCREMENT values.
parent b8b3edff
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
--source include/not_embedded.inc --source include/not_embedded.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_sequence.inc
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT."); call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it");
FLUSH TABLES; FLUSH TABLES;
...@@ -17,17 +18,14 @@ CREATE TABLE t1 ...@@ -17,17 +18,14 @@ CREATE TABLE t1
KEY (b)) KEY (b))
ENGINE = InnoDB; ENGINE = InnoDB;
insert into t1 (b, c) values ('Apa', 'Filler........'), CREATE TEMPORARY TABLE t (b char(22),c varchar(255));
INSERT INTO t VALUES
('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'), ('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg'); ('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; DROP TEMPORARY TABLE t;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
...@@ -107,16 +105,11 @@ CREATE TABLE t1( ...@@ -107,16 +105,11 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB; c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -158,15 +151,10 @@ CREATE TABLE t1( ...@@ -158,15 +151,10 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB; c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -177,9 +165,6 @@ UNLOCK TABLES; ...@@ -177,9 +165,6 @@ UNLOCK TABLES;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -212,14 +197,9 @@ CREATE TABLE t1( ...@@ -212,14 +197,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB; c2 INT, INDEX(c2)) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -228,9 +208,6 @@ EOF ...@@ -228,9 +208,6 @@ EOF
UNLOCK TABLES; UNLOCK TABLES;
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -263,14 +240,9 @@ CREATE TABLE t1( ...@@ -263,14 +240,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB; c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -278,9 +250,6 @@ EOF ...@@ -278,9 +250,6 @@ EOF
UNLOCK TABLES; UNLOCK TABLES;
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -330,14 +299,7 @@ CREATE TABLE t1( ...@@ -330,14 +299,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB; c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
# This should fail, InnoDB should return a warning # This should fail, InnoDB should return a warning
...@@ -357,15 +319,9 @@ CREATE TABLE t1( ...@@ -357,15 +319,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB; c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -492,15 +448,9 @@ CREATE TABLE t1( ...@@ -492,15 +448,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -645,15 +595,9 @@ CREATE TABLE t1( ...@@ -645,15 +595,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT; c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -799,15 +743,9 @@ CREATE TABLE t1( ...@@ -799,15 +743,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -953,15 +891,9 @@ CREATE TABLE t1( ...@@ -953,15 +891,9 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -1126,9 +1058,8 @@ SELECT * FROM t1; ...@@ -1126,9 +1058,8 @@ SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
FLUSH TABLES;
# cleanup # cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
......
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT."); call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
CREATE TABLE t1 CREATE TABLE t1
(a INT AUTO_INCREMENT PRIMARY KEY, (a INT AUTO_INCREMENT PRIMARY KEY,
...@@ -6,29 +6,26 @@ b char(22), ...@@ -6,29 +6,26 @@ b char(22),
c varchar(255), c varchar(255),
KEY (b)) KEY (b))
ENGINE = InnoDB ROW_FORMAT=COMPRESSED ; ENGINE = InnoDB ROW_FORMAT=COMPRESSED ;
insert into t1 (b, c) values ('Apa', 'Filler........'), CREATE TEMPORARY TABLE t (b char(22),c varchar(255));
INSERT INTO t VALUES
('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'), ('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg'); ('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; DROP TEMPORARY TABLE t;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
COUNT(*) COUNT(*)
640 640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c a b c
819 Apa Filler........ 636 Apa Filler........
814 Apa Filler........ 631 Apa Filler........
809 Apa Filler........ 626 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c a b c
823 Evolution lsjndofiabsoibeg 640 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf 639 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf 638 Cavalry ..asdasdfaeraf
db.opt db.opt
t1.frm t1.frm
t1.ibd t1.ibd
...@@ -47,14 +44,14 @@ COUNT(*) ...@@ -47,14 +44,14 @@ COUNT(*)
1280 1280
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c a b c
1459 Apa Filler........ 1276 Apa Filler........
1454 Apa Filler........ 1271 Apa Filler........
1449 Apa Filler........ 1266 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c a b c
1463 Evolution lsjndofiabsoibeg 1280 Evolution lsjndofiabsoibeg
1462 Devotion asdfuihknaskdf 1279 Devotion asdfuihknaskdf
1461 Cavalry ..asdasdfaeraf 1278 Cavalry ..asdasdfaeraf
# Restarting server # Restarting server
# Done restarting server # Done restarting server
# List before t1 DISCARD # List before t1 DISCARD
...@@ -72,14 +69,14 @@ COUNT(*) ...@@ -72,14 +69,14 @@ COUNT(*)
640 640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c a b c
819 Apa Filler........ 636 Apa Filler........
814 Apa Filler........ 631 Apa Filler........
809 Apa Filler........ 626 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c a b c
823 Evolution lsjndofiabsoibeg 640 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf 639 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf 638 Cavalry ..asdasdfaeraf
db.opt db.opt
t1.cfg t1.cfg
t1.frm t1.frm
...@@ -89,14 +86,14 @@ COUNT(*) ...@@ -89,14 +86,14 @@ COUNT(*)
640 640
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
a b c a b c
819 Apa Filler........ 636 Apa Filler........
814 Apa Filler........ 631 Apa Filler........
809 Apa Filler........ 626 Apa Filler........
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
a b c a b c
823 Evolution lsjndofiabsoibeg 640 Evolution lsjndofiabsoibeg
822 Devotion asdfuihknaskdf 639 Devotion asdfuihknaskdf
821 Cavalry ..asdasdfaeraf 638 Cavalry ..asdasdfaeraf
DROP TABLE t1; DROP TABLE t1;
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -112,18 +109,11 @@ DROP TABLE t1; ...@@ -112,18 +109,11 @@ DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
db.opt db.opt
t1.frm t1.frm
t1.ibd t1.ibd
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
backup: t1 backup: t1
db.opt db.opt
t1.cfg t1.cfg
...@@ -153,11 +143,7 @@ DROP TABLE t1; ...@@ -153,11 +143,7 @@ DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
db.opt db.opt
t1.frm t1.frm
t1.ibd t1.ibd
...@@ -174,8 +160,6 @@ UNLOCK TABLES; ...@@ -174,8 +160,6 @@ UNLOCK TABLES;
db.opt db.opt
t1.frm t1.frm
t1.ibd t1.ibd
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...@@ -200,23 +184,14 @@ CREATE TABLE t1( ...@@ -200,23 +184,14 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX(c2)) ENGINE=InnoDB c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
COUNT(*)
16
backup: t1 backup: t1
db.opt db.opt
t1.cfg t1.cfg
t1.frm t1.frm
t1.ibd t1.ibd
UNLOCK TABLES; UNLOCK TABLES;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...@@ -238,19 +213,10 @@ CREATE TABLE t1( ...@@ -238,19 +213,10 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
COUNT(*)
16
backup: t1 backup: t1
UNLOCK TABLES; UNLOCK TABLES;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...@@ -279,39 +245,32 @@ c1 c2 ...@@ -279,39 +245,32 @@ c1 c2
2 1 2 1
3 1 3 1
4 1 4 1
5 1
6 1 6 1
7 1 7 1
8 1 8 1
9 1 9 1
10 1
11 1
12 1
13 1 13 1
14 1 14 1
15 1 15 1
16 1 16 1
17 1
18 1
19 1
20 1
unlink: t1.cfg unlink: t1.cfg
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL innodb_file_per_table = 0; SET GLOBAL innodb_file_per_table = 0;
CREATE TABLE t1( CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB; c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
16
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`c1` int(11) NOT NULL AUTO_INCREMENT, `c1` int(11) NOT NULL AUTO_INCREMENT,
`c2` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`) PRIMARY KEY (`c1`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
Warnings: Warnings:
Warning 1809 Table `test`.`t1` in system tablespace Warning 1809 Table `test`.`t1` in system tablespace
...@@ -322,12 +281,7 @@ CREATE TABLE t1( ...@@ -322,12 +281,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT, INDEX idx(c2)) ENGINE=InnoDB c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -335,41 +289,7 @@ t1 CREATE TABLE `t1` ( ...@@ -335,41 +289,7 @@ t1 CREATE TABLE `t1` (
`c2` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`), PRIMARY KEY (`c1`),
KEY `idx` (`c2`) KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT * FROM t1;
c1 c2
1 1
2 1
3 1
4 1
6 1
7 1
8 1
9 1
13 1
14 1
15 1
16 1
17 1
18 1
19 1
20 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
backup: t1 backup: t1
UNLOCK TABLES; UNLOCK TABLES;
...@@ -447,42 +367,26 @@ t1 CREATE TABLE `t1` ( ...@@ -447,42 +367,26 @@ t1 CREATE TABLE `t1` (
`c2` int(11) DEFAULT NULL, `c2` int(11) DEFAULT NULL,
PRIMARY KEY (`c1`), PRIMARY KEY (`c1`),
KEY `idx` (`c2`) KEY `idx` (`c2`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT * FROM t1; SELECT * FROM t1;
c1 c2 c1 c2
1 1 1 1
2 1 2 1
3 1 3 1
4 1 4 1
5 1
6 1 6 1
7 1 7 1
8 1 8 1
9 1 9 1
10 1
11 1
12 1
13 1 13 1
14 1 14 1
15 1 15 1
16 1 16 1
17 1
18 1
19 1
20 1
28 1
29 1
30 1
31 1
32 1
33 1
34 1
35 1
36 1
37 1
38 1
39 1
40 1
41 1
42 1
43 1
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
--source include/not_embedded.inc --source include/not_embedded.inc
-- source include/innodb_page_size_small.inc -- source include/innodb_page_size_small.inc
-- source include/have_sequence.inc
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT."); call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
...@@ -17,17 +18,14 @@ CREATE TABLE t1 ...@@ -17,17 +18,14 @@ CREATE TABLE t1
KEY (b)) KEY (b))
ENGINE = InnoDB ROW_FORMAT=COMPRESSED ; ENGINE = InnoDB ROW_FORMAT=COMPRESSED ;
insert into t1 (b, c) values ('Apa', 'Filler........'), CREATE TEMPORARY TABLE t (b char(22),c varchar(255));
INSERT INTO t VALUES
('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'), ('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg'); ('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; DROP TEMPORARY TABLE t;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t1; SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
...@@ -89,16 +87,11 @@ CREATE TABLE t1( ...@@ -89,16 +87,11 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -140,11 +133,7 @@ CREATE TABLE t1( ...@@ -140,11 +133,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -159,9 +148,6 @@ UNLOCK TABLES; ...@@ -159,9 +148,6 @@ UNLOCK TABLES;
--list_files $MYSQLD_DATADIR/test --list_files $MYSQLD_DATADIR/test
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -195,14 +181,9 @@ CREATE TABLE t1( ...@@ -195,14 +181,9 @@ CREATE TABLE t1(
c2 INT, INDEX(c2)) ENGINE=InnoDB c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -211,9 +192,6 @@ EOF ...@@ -211,9 +192,6 @@ EOF
UNLOCK TABLES; UNLOCK TABLES;
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1( CREATE TABLE t1(
...@@ -250,14 +228,9 @@ eval CREATE TABLE t1( ...@@ -250,14 +228,9 @@ eval CREATE TABLE t1(
c2 INT, INDEX idx(c2)) ENGINE=InnoDB c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE; ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1"); ib_backup_tablespaces("test", "t1");
...@@ -265,9 +238,6 @@ EOF ...@@ -265,9 +238,6 @@ EOF
UNLOCK TABLES; UNLOCK TABLES;
# Move the LSN forward # Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1; DROP TABLE t1;
--replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16 --replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16
...@@ -319,14 +289,7 @@ CREATE TABLE t1( ...@@ -319,14 +289,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB; c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
# This should fail, InnoDB should return a warning # This should fail, InnoDB should return a warning
...@@ -347,15 +310,9 @@ CREATE TABLE t1( ...@@ -347,15 +310,9 @@ CREATE TABLE t1(
c2 INT, INDEX idx(c2)) ENGINE=InnoDB c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1); INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT; FLUSH TABLES t1 FOR EXPORT;
...@@ -511,7 +468,7 @@ SELECT * FROM t1; ...@@ -511,7 +468,7 @@ SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*"); call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
# cleanup # cleanup
......
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