diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-20 16:34:15 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-20 16:34:15 +0200 |
commit | b034d708c813fa9c274fe14a1492dac62c923cb7 (patch) | |
tree | 7f3127139599b3db2b2e31ddf320b0a431a1f7f0 | |
parent | b8b3edff1376dc68c13d819470edfb33c339a64b (diff) | |
download | mariadb-git-b034d708c813fa9c274fe14a1492dac62c923cb7.tar.gz |
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.
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-wl5522-debug.result | 1050 | ||||
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-wl5522.result | 576 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-wl5522-debug.test | 770 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-wl5522.test | 105 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result | 577 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/r/wl5522_zip.result | 192 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test | 381 | ||||
-rw-r--r-- | mysql-test/suite/innodb_zip/t/wl5522_zip.test | 71 |
8 files changed, 1478 insertions, 2244 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result index 99e9c49eee9..da064b83be6 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522-debug.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522-debug.result @@ -10,62 +10,59 @@ call mtr.add_suppression("InnoDB: Page for tablespace "); call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS="); FLUSH TABLES; SET GLOBAL innodb_file_per_table = 1; -CREATE DATABASE test_wl5522; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; ERROR HY000: Lost connection to MySQL server during query -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); SET SESSION debug_dbug="+d,ib_discard_after_commit_crash"; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; ERROR HY000: Lost connection to MySQL server during query -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1), (2), (3), (4); +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Lost connection to MySQL server during query -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Lost connection to MySQL server during query unlink: t1.ibd unlink: t1.cfg -DROP TABLE test_wl5522.t1; +DROP TABLE t1; +SET @file_per_table= @@innodb_file_per_table; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -@@innodb_file_per_table -1 -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; Table Op Msg_type Msg_text -test_wl5522.t1 check status OK -SELECT COUNT(*) FROM test_wl5522.t1; +test.t1 check status OK +SELECT COUNT(*) FROM t1; COUNT(*) 4 -INSERT INTO test_wl5522.t1 VALUES(400), (500), (600); -SELECT * FROM test_wl5522.t1; +INSERT INTO t1 VALUES(400), (500), (600); +SELECT * FROM t1; c1 1 2 @@ -74,419 +71,419 @@ c1 400 500 600 -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_export_io_write_failure_1"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_2"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_3"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_4"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_5"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_6"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_7"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_8"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_9"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_10"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_11"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_12"; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flush() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (100), (200), (300); -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (100), (200), (300); +SELECT COUNT(*) FROM t1; COUNT(*) 3 -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_1"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading index fields. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_2"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading index meta-data, expected to read 44 bytes but read only 0 bytes SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_3"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading number of indexes. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_4"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading table column meta-data. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_5"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading meta-data export hostname length. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_6"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading meta-data table name length. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_7"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading autoinc value. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_8"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading meta-data header. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_io_read_error_9"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while reading meta-data version. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_string_read_error"; restore: t1 .cfg file -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: IO Read error: while parsing export hostname. SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_1"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_2"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_4"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_5"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_6"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_7"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_8"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_9"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_OOM_10"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_internal_error"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Too many concurrent transactions +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Too many concurrent transactions restore: t1 .ibd and .cfg files SET SESSION debug_dbug=@saved_debug_dbug; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 44 'Tablespace not found' from ./test_wl5522/t1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 44 'Tablespace not found' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_cluster_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; unlink: t1.ibd unlink: t1.cfg -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 ( +DROP TABLE t1; +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -500,35 +497,29 @@ connection default; SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; -INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES -(1, REPEAT('a', 2048), REPEAT('a', 2048)), -(2, REPEAT('b', 2048), REPEAT('b', 2048)), -(3, REPEAT('c', 2048), REPEAT('c', 2048)), -(4, REPEAT('d', 2048), REPEAT('d', 2048)); -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -DELETE FROM test_wl5522.t1 WHERE c2 = 1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024); -UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024); -SHOW CREATE TABLE test_wl5522.t1; +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); +SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL AUTO_INCREMENT, @@ -539,116 +530,148 @@ t1 CREATE TABLE `t1` ( KEY `idx1` (`c2`), KEY `idx2` (`c3`(512)), KEY `idx3` (`c4`(512)) -) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 -SELECT c1, c2 FROM test_wl5522.t1; +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 +SELECT c1, c2 FROM t1; c1 c2 +1 16 2 32 3 48 4 64 +5 76 6 92 7 108 8 124 -13 197 -14 213 -15 229 -17 257 -18 273 -19 289 -28 422 -29 438 -30 454 -32 482 -33 498 -34 514 -36 542 -37 558 -38 574 -40 602 -41 618 -42 634 -59 887 -60 903 -61 919 -63 947 -64 963 -65 979 -67 1007 -68 1023 -69 1039 -71 1067 -72 1083 -73 1099 -75 1127 -76 1143 -77 1159 -79 1187 -80 1203 -81 1219 -83 1247 -84 1263 -85 1279 -87 1307 -88 1323 -89 1339 +9 136 +10 152 +11 168 +12 184 +13 196 +14 212 +15 228 +16 244 +17 256 +18 272 +19 288 +20 304 +21 316 +22 332 +23 348 +24 364 +25 376 +26 392 +27 408 +28 424 +29 436 +30 452 +31 468 +32 484 +33 496 +34 512 +35 528 +36 544 +37 556 +38 572 +39 588 +40 604 +41 616 +42 632 +43 648 +44 664 +45 676 +46 692 +47 708 +48 724 +49 736 +50 752 +51 768 +52 784 +53 796 +54 812 +55 828 +56 844 +57 856 +58 872 +59 888 +60 904 +61 916 +62 932 +63 948 +64 964 +65 976 +66 992 +67 1008 +68 1024 +69 1036 +70 1052 +71 1068 +72 1084 +73 1096 +74 1112 +75 1128 +76 1144 +77 1156 +78 1172 +79 1188 +80 1204 +81 1216 +82 1232 +83 1248 +84 1264 +85 1276 +86 1292 +87 1308 +88 1324 +89 1336 +90 1352 +91 1368 +92 1384 +93 1396 +94 1412 +95 1428 +96 1444 +97 1456 +98 1472 +99 1488 +100 1504 +101 1516 +102 1532 +103 1548 +104 1564 +105 1576 +106 1592 +107 1608 +108 1624 +109 1636 +110 1652 +111 1668 +112 1684 +113 1696 +114 1712 +115 1728 +116 1744 +117 1756 +118 1772 +119 1788 +120 1804 +121 1816 122 1832 123 1848 124 1864 +125 1876 126 1892 127 1908 128 1924 -130 1952 -131 1968 -132 1984 -134 2012 -135 2028 -136 2044 -138 2072 -139 2088 -140 2104 -142 2132 -143 2148 -144 2164 -146 2192 -147 2208 -148 2224 -150 2252 -151 2268 -152 2284 -154 2312 -155 2328 -156 2344 -158 2372 -159 2388 -160 2404 -162 2432 -163 2448 -164 2464 -166 2492 -167 2508 -168 2524 -170 2552 -171 2568 -172 2584 -174 2612 -175 2628 -176 2644 -178 2672 -179 2688 -180 2704 -182 2732 -183 2748 -184 2764 -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; COUNT(*) -96 -SELECT SUM(c2) FROM test_wl5522.t1; +128 +SELECT SUM(c2) FROM t1; SUM(c2) -145278 +124160 SELECT name FROM information_schema.innodb_metrics WHERE name = 'ibuf_merges_insert' AND count = 0; name -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; SELECT name @@ -665,8 +688,8 @@ connection purge_control; COMMIT; disconnect purge_control; connection default; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 ( +DROP TABLE t1; +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -674,119 +697,151 @@ c4 VARCHAR(2048), INDEX idx1(c2), INDEX idx2(c3(512)), INDEX idx3(c4(512))) Engine=InnoDB; -SELECT c1, c2 FROM test_wl5522.t1; +SELECT c1, c2 FROM t1; c1 c2 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; Table Op Msg_type Msg_text -test_wl5522.t1 check status OK -SELECT c1,c2 FROM test_wl5522.t1; +test.t1 check status OK +SELECT c1,c2 FROM t1; c1 c2 +1 16 2 32 3 48 4 64 +5 76 6 92 7 108 8 124 -13 197 -14 213 -15 229 -17 257 -18 273 -19 289 -28 422 -29 438 -30 454 -32 482 -33 498 -34 514 -36 542 -37 558 -38 574 -40 602 -41 618 -42 634 -59 887 -60 903 -61 919 -63 947 -64 963 -65 979 -67 1007 -68 1023 -69 1039 -71 1067 -72 1083 -73 1099 -75 1127 -76 1143 -77 1159 -79 1187 -80 1203 -81 1219 -83 1247 -84 1263 -85 1279 -87 1307 -88 1323 -89 1339 +9 136 +10 152 +11 168 +12 184 +13 196 +14 212 +15 228 +16 244 +17 256 +18 272 +19 288 +20 304 +21 316 +22 332 +23 348 +24 364 +25 376 +26 392 +27 408 +28 424 +29 436 +30 452 +31 468 +32 484 +33 496 +34 512 +35 528 +36 544 +37 556 +38 572 +39 588 +40 604 +41 616 +42 632 +43 648 +44 664 +45 676 +46 692 +47 708 +48 724 +49 736 +50 752 +51 768 +52 784 +53 796 +54 812 +55 828 +56 844 +57 856 +58 872 +59 888 +60 904 +61 916 +62 932 +63 948 +64 964 +65 976 +66 992 +67 1008 +68 1024 +69 1036 +70 1052 +71 1068 +72 1084 +73 1096 +74 1112 +75 1128 +76 1144 +77 1156 +78 1172 +79 1188 +80 1204 +81 1216 +82 1232 +83 1248 +84 1264 +85 1276 +86 1292 +87 1308 +88 1324 +89 1336 +90 1352 +91 1368 +92 1384 +93 1396 +94 1412 +95 1428 +96 1444 +97 1456 +98 1472 +99 1488 +100 1504 +101 1516 +102 1532 +103 1548 +104 1564 +105 1576 +106 1592 +107 1608 +108 1624 +109 1636 +110 1652 +111 1668 +112 1684 +113 1696 +114 1712 +115 1728 +116 1744 +117 1756 +118 1772 +119 1788 +120 1804 +121 1816 122 1832 123 1848 124 1864 +125 1876 126 1892 127 1908 128 1924 -130 1952 -131 1968 -132 1984 -134 2012 -135 2028 -136 2044 -138 2072 -139 2088 -140 2104 -142 2132 -143 2148 -144 2164 -146 2192 -147 2208 -148 2224 -150 2252 -151 2268 -152 2284 -154 2312 -155 2328 -156 2344 -158 2372 -159 2388 -160 2404 -162 2432 -163 2448 -164 2464 -166 2492 -167 2508 -168 2524 -170 2552 -171 2568 -172 2584 -174 2612 -175 2628 -176 2644 -178 2672 -179 2688 -180 2704 -182 2732 -183 2748 -184 2764 -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; COUNT(*) -96 -SELECT SUM(c2) FROM test_wl5522.t1; +128 +SELECT SUM(c2) FROM t1; SUM(c2) -145278 -SHOW CREATE TABLE test_wl5522.t1; +124160 +SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL AUTO_INCREMENT, @@ -797,129 +852,120 @@ t1 CREATE TABLE `t1` ( KEY `idx1` (`c2`), KEY `idx2` (`c3`(512)), KEY `idx3` (`c4`(512)) -) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -INSERT IGNORE INTO test_wl5522.t1 VALUES +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +INSERT IGNORE INTO t1 VALUES (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731)); Warnings: Warning 1265 Data truncated for column 'c2' at row 1 -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -COUNT(*) -256 -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; -ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); +ALTER TABLE t1 ADD INDEX idx(c1); Warnings: Warning 1814 Tablespace has been discarded for table `t1` SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,fil_space_create_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 11 'Generic error' from ./test_wl5522/t1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 11 'Generic error' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 39 'Data structure corruption' from ./test_wl5522/t1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 39 'Data structure corruption' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -DROP DATABASE test_wl5522; set global innodb_monitor_disable = all; set global innodb_monitor_reset_all = all; set global innodb_monitor_enable = default; set global innodb_monitor_disable = default; set global innodb_monitor_reset = default; set global innodb_monitor_reset_all = default; -SET GLOBAL INNODB_FILE_PER_TABLE=1; +SET GLOBAL INNODB_FILE_PER_TABLE=@file_per_table; diff --git a/mysql-test/suite/innodb/r/innodb-wl5522.result b/mysql-test/suite/innodb/r/innodb-wl5522.result index b364b36a36f..27a93922fbf 100644 --- a/mysql-test/suite/innodb/r/innodb-wl5522.result +++ b/mysql-test/suite/innodb/r/innodb-wl5522.result @@ -1,4 +1,4 @@ -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"); FLUSH TABLES; CREATE TABLE t1 @@ -7,29 +7,26 @@ b char(22), c varchar(255), KEY (b)) 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'), ('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 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; -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; +DROP TEMPORARY TABLE t; SELECT COUNT(*) FROM t1; COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPACT; db.opt t1.frm @@ -52,14 +49,14 @@ COUNT(*) 1280 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -1459 Apa Filler........ -1454 Apa Filler........ -1449 Apa Filler........ +1276 Apa Filler........ +1271 Apa Filler........ +1266 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -1463 Evolution lsjndofiabsoibeg -1462 Devotion asdfuihknaskdf -1461 Cavalry ..asdasdfaeraf +1280 Evolution lsjndofiabsoibeg +1279 Devotion asdfuihknaskdf +1278 Cavalry ..asdasdfaeraf # Restarting server # Done restarting server # List before t1 DISCARD @@ -81,14 +78,14 @@ COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf db.opt t1.cfg t1.frm @@ -100,14 +97,14 @@ COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf DROP TABLE t1; ALTER TABLE t2 ROW_FORMAT=DYNAMIC; ALTER TABLE t2 DISCARD TABLESPACE; @@ -136,18 +133,11 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; db.opt t1.frm t1.ibd FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; -COUNT(*) -16 backup: t1 db.opt t1.cfg @@ -177,18 +167,11 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; db.opt t1.frm t1.ibd FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; -COUNT(*) -16 backup: t1 db.opt t1.cfg @@ -198,8 +181,6 @@ UNLOCK TABLES; db.opt t1.frm t1.ibd -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -223,23 +204,14 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; -COUNT(*) -16 backup: t1 db.opt t1.cfg t1.frm t1.ibd UNLOCK TABLES; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -259,19 +231,10 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; -COUNT(*) -16 backup: t1 UNLOCK TABLES; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -299,39 +262,32 @@ c1 c2 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 1 13 1 14 1 15 1 16 1 -17 1 -18 1 -19 1 -20 1 unlink: t1.cfg DROP TABLE t1; SET GLOBAL innodb_file_per_table = 0; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1809 Table `test`.`t1` in system tablespace @@ -341,12 +297,7 @@ SET GLOBAL innodb_file_per_table = 1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -354,41 +305,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 -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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -449,51 +366,30 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -501,41 +397,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT -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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -559,41 +421,25 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -647,51 +493,30 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -699,41 +524,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT -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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -757,41 +548,25 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -848,51 +623,30 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -900,41 +654,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC -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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -958,41 +678,25 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -1049,51 +753,30 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC SELECT * FROM t1; c1 c2 1 1 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -1101,41 +784,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -1159,41 +808,25 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), 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 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -1263,43 +896,26 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), 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 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; 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"); -FLUSH TABLES; diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index b443c92aff9..b2809aa0669 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -15,6 +15,7 @@ --source include/have_innodb.inc --source include/default_charset.inc +--source include/have_sequence.inc call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation."); call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified."); @@ -29,16 +30,11 @@ call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS="); FLUSH TABLES; let MYSQLD_DATADIR =`SELECT @@datadir`; -let $innodb_file_per_table = `SELECT @@innodb_file_per_table`; -let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/; let $strerrfix=/ (\(.+\))//; - SET GLOBAL innodb_file_per_table = 1; -CREATE DATABASE test_wl5522; - -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); --let $_server_id= `SELECT @@server_id` --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect @@ -46,574 +42,574 @@ INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_after_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; # Create the table that we will use for crash recovery (during IMPORT) -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1), (2), (3), (4); --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF --error ER_TABLESPACE_DISCARDED -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; --source include/start_mysqld.inc # Check that the DD is consistent after recovery --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # After the above test the results are non-deterministic, # delete the old tablespace files and drop the table, # recreate the table and do a proper import. perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; +SET @file_per_table= @@innodb_file_per_table; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; -INSERT INTO test_wl5522.t1 VALUES(400), (500), (600); +INSERT INTO t1 VALUES(400), (500), (600); -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test IO Write error(s), flush tables doesn't return an error message # so we have to make do with the error/warning pushed by the server -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_export_io_write_failure_1"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_2"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_3"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_4"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_5"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_6"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_7"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_8"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_9"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_10"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_11"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_12"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Create a table and save the tablespace and .cfg file -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (100), (200), (300); -SELECT COUNT(*) FROM test_wl5522.t1; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (100), (200), (300); +SELECT COUNT(*) FROM t1; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test IO Read error(s) -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_1"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_2"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_3"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_4"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_5"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_6"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_7"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_8"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_9"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test string read failure -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_string_read_error"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test OOM error during import -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_1"; @@ -621,31 +617,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_1"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_2"; @@ -653,31 +649,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_2"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_4"; @@ -685,31 +681,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_4"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_5"; @@ -717,30 +713,30 @@ SET SESSION debug_dbug="+d,ib_import_OOM_5"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_6"; @@ -748,29 +744,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_6"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_7"; @@ -778,29 +774,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_7"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_8"; @@ -808,29 +804,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_8"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_9"; @@ -838,29 +834,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_9"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_10"; @@ -868,30 +864,30 @@ SET SESSION debug_dbug="+d,ib_import_OOM_10"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF #### # Test handling of internal failure error -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace @@ -900,33 +896,33 @@ SET SESSION debug_dbug="+d,ib_import_internal_error"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test failure after reset of space id and LSN in the tablespace -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace @@ -935,12 +931,12 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug=@saved_debug_dbug; @@ -948,17 +944,16 @@ SET SESSION debug_dbug=@saved_debug_dbug; # Test failure after attempting a tablespace open SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ---replace_regex /file: '.*t1.ibd'/'t1.ibd'/ - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after ibuf check @@ -966,73 +961,73 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; # Need proper mapping of error codes :-( --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after adjusting the cluster index root page SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_cluster_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the secondary index(es) SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Left over from the failed IMPORT perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -DROP TABLE test_wl5522.t1; +DROP TABLE t1; --disable_query_log # Enable metrics for the counters we are going to use @@ -1046,7 +1041,7 @@ set global innodb_monitor_enable = ibuf_merges_insert; # Create a large table with delete marked records, disable purge during # the update so that we can test the IMPORT purge code. # -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -1066,53 +1061,45 @@ SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; -INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES - (1, REPEAT('a', 2048), REPEAT('a', 2048)), - (2, REPEAT('b', 2048), REPEAT('b', 2048)), - (3, REPEAT('c', 2048), REPEAT('c', 2048)), - (4, REPEAT('d', 2048), REPEAT('d', 2048)); - -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; - -DELETE FROM test_wl5522.t1 WHERE c2 = 1; - -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024); -UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024); - -SHOW CREATE TABLE test_wl5522.t1; - -SELECT c1, c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; + +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); + +SHOW CREATE TABLE t1; + +SELECT c1, c2 FROM t1; +SELECT COUNT(*) FROM t1; +SELECT SUM(c2) FROM t1; SELECT name FROM information_schema.innodb_metrics WHERE name = 'ibuf_merges_insert' AND count = 0; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; @@ -1133,9 +1120,9 @@ COMMIT; disconnect purge_control; connection default; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -1144,65 +1131,59 @@ CREATE TABLE test_wl5522.t1 ( INDEX idx2(c3(512)), INDEX idx3(c4(512))) Engine=InnoDB; -SELECT c1, c2 FROM test_wl5522.t1; +SELECT c1, c2 FROM t1; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT c1,c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; +SELECT c1,c2 FROM t1; +SELECT COUNT(*) FROM t1; +SELECT SUM(c2) FROM t1; -SHOW CREATE TABLE test_wl5522.t1; +SHOW CREATE TABLE t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; #### # Create a table and save the tablespace and .cfg file, we need to create # a Btree that has several levels -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -INSERT IGNORE INTO test_wl5522.t1 VALUES +INSERT IGNORE INTO t1 VALUES (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731)); -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; @@ -1210,30 +1191,30 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; @@ -1241,172 +1222,166 @@ SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; ---replace_regex $pathfix - --error ER_INNODB_INDEX_CORRUPT -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; ---replace_regex $pathfix - --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; -ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); +ALTER TABLE t1 ADD INDEX idx(c1); SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fil_space_create_failure"; ---replace_regex $pathfix - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ---replace_regex $pathfix - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; @@ -1414,20 +1389,17 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF - -DROP DATABASE test_wl5522; - set global innodb_monitor_disable = all; set global innodb_monitor_reset_all = all; @@ -1451,12 +1423,10 @@ call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tabl call mtr.add_suppression(".*There was an error writing to the meta data file.*"); call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file"); call mtr.add_suppression("Unsupported tablespace format"); -call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\""); call mtr.add_suppression("Page is marked as free"); call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted"); call mtr.add_suppression("but tablespace with that id or name does not exist"); -call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache"); -call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'"); +call mtr.add_suppression("Could not find a valid tablespace file for '.*t1'"); call mtr.add_suppression("while reading index meta-data, expected to read 44 bytes but read only 0 bytes"); call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it"); --enable_query_log @@ -1465,4 +1435,4 @@ call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it"); --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd -eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table; +SET GLOBAL INNODB_FILE_PER_TABLE=@file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test index 0f5910245ed..906246ebf07 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522.test @@ -2,8 +2,9 @@ --source include/not_embedded.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"); FLUSH TABLES; @@ -17,17 +18,14 @@ CREATE TABLE t1 KEY (b)) 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'), ('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 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; -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; +DROP TEMPORARY TABLE t; SELECT COUNT(*) FROM t1; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3; @@ -107,16 +105,11 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -158,15 +151,10 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -177,9 +165,6 @@ UNLOCK TABLES; --list_files $MYSQLD_DATADIR/test # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -212,14 +197,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -228,9 +208,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -263,14 +240,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -278,9 +250,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -330,14 +299,7 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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; - +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; # This should fail, InnoDB should return a warning @@ -357,15 +319,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -492,15 +448,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -645,15 +595,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -799,15 +743,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -953,15 +891,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -1126,9 +1058,8 @@ SELECT * FROM t1; DROP TABLE t1; 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"); -FLUSH TABLES; # cleanup --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result index 394a2ea1f09..4036640d3d3 100644 --- a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result +++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result @@ -1,53 +1,52 @@ -call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue."); -call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*"); +call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded\\."); +call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue\\."); +call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file"); call mtr.add_suppression("InnoDB: Page for tablespace "); call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x"); FLUSH TABLES; SET SESSION innodb_strict_mode=1; -CREATE DATABASE test_wl5522; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 VALUES (1), (2), (3), (4); +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -INSERT INTO test_wl5522.t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Lost connection to MySQL server during query SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Lost connection to MySQL server during query unlink: t1.ibd unlink: t1.cfg # Restart and reconnect to the server -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET SESSION innodb_strict_mode=1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; Table Op Msg_type Msg_text -test_wl5522.t1 check status OK -SELECT COUNT(*) FROM test_wl5522.t1; +test.t1 check status OK +SELECT COUNT(*) FROM t1; COUNT(*) 4 -INSERT INTO test_wl5522.t1 VALUES(400), (500), (600); -SELECT * FROM test_wl5522.t1; +INSERT INTO t1 VALUES(400), (500), (600); +SELECT * FROM t1; c1 1 2 @@ -56,65 +55,65 @@ c1 400 500 600 -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_import_internal_error"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +ALTER TABLE t1 IMPORT TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Too many concurrent transactions +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Too many concurrent transactions restore: t1 .ibd and .cfg files SET SESSION debug_dbug=@saved_debug_dbug; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 44 't1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 44 'Tablespace not found' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_cluster_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; unlink: t1.ibd unlink: t1.cfg -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 ( +DROP TABLE t1; +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -129,35 +128,30 @@ connection default; SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; -INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES -(1, REPEAT('a', 2048), REPEAT('a', 2048)), -(2, REPEAT('b', 2048), REPEAT('b', 2048)), -(3, REPEAT('c', 2048), REPEAT('c', 2048)), -(4, REPEAT('d', 2048), REPEAT('d', 2048)); -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -DELETE FROM test_wl5522.t1 WHERE c2 = 1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024); -UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024); -SHOW CREATE TABLE test_wl5522.t1; +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; +DELETE FROM t1 WHERE c2 = 1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); +SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL AUTO_INCREMENT, @@ -168,134 +162,22 @@ t1 CREATE TABLE `t1` ( KEY `idx1` (`c2`), KEY `idx2` (`c3`(512)), KEY `idx3` (`c4`(512)) -) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED -SELECT c1, c2 FROM test_wl5522.t1; -c1 c2 -2 32 -3 48 -4 64 -6 92 -7 108 -8 124 -13 197 -14 213 -15 229 -17 257 -18 273 -19 289 -28 422 -29 438 -30 454 -32 482 -33 498 -34 514 -36 542 -37 558 -38 574 -40 602 -41 618 -42 634 -59 887 -60 903 -61 919 -63 947 -64 963 -65 979 -67 1007 -68 1023 -69 1039 -71 1067 -72 1083 -73 1099 -75 1127 -76 1143 -77 1159 -79 1187 -80 1203 -81 1219 -83 1247 -84 1263 -85 1279 -87 1307 -88 1323 -89 1339 -122 1832 -123 1848 -124 1864 -126 1892 -127 1908 -128 1924 -130 1952 -131 1968 -132 1984 -134 2012 -135 2028 -136 2044 -138 2072 -139 2088 -140 2104 -142 2132 -143 2148 -144 2164 -146 2192 -147 2208 -148 2224 -150 2252 -151 2268 -152 2284 -154 2312 -155 2328 -156 2344 -158 2372 -159 2388 -160 2404 -162 2432 -163 2448 -164 2464 -166 2492 -167 2508 -168 2524 -170 2552 -171 2568 -172 2584 -174 2612 -175 2628 -176 2644 -178 2672 -179 2688 -180 2704 -182 2732 -183 2748 -184 2764 -SELECT COUNT(*) FROM test_wl5522.t1; -COUNT(*) -96 -SELECT SUM(c2) FROM test_wl5522.t1; -SUM(c2) -145278 -SELECT name -FROM information_schema.innodb_metrics -WHERE name = 'ibuf_merges_insert' AND count = 0; -name -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -SELECT name -FROM information_schema.innodb_metrics -WHERE name = 'ibuf_merges' AND count > 0; +SELECT name FROM information_schema.innodb_metrics +WHERE name IN ('ibuf_merges','ibuf_merges_insert') AND count>0 ORDER BY name; name ibuf_merges -SELECT name -FROM information_schema.innodb_metrics -WHERE name = 'ibuf_merges_inserts' AND count > 0; -name +ibuf_merges_insert SET GLOBAL innodb_disable_background_merge=OFF; connection purge_control; COMMIT; disconnect purge_control; connection default; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 ( +DROP TABLE t1; +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -304,15 +186,15 @@ INDEX idx1(c2), INDEX idx2(c3(512)), INDEX idx3(c4(512))) Engine=InnoDB ROW_FORMAT=COMPRESSED; -SELECT c1, c2 FROM test_wl5522.t1; +SELECT c1, c2 FROM t1; c1 c2 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; restore: t1 .ibd and .cfg files -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; Table Op Msg_type Msg_text -test_wl5522.t1 check status OK -SELECT c1,c2 FROM test_wl5522.t1; +test.t1 check status OK +SELECT c1,c2 FROM t1; c1 c2 2 32 3 48 @@ -320,103 +202,97 @@ c1 c2 6 92 7 108 8 124 -13 197 -14 213 -15 229 -17 257 -18 273 -19 289 -28 422 -29 438 -30 454 -32 482 -33 498 -34 514 -36 542 -37 558 -38 574 -40 602 -41 618 -42 634 -59 887 -60 903 -61 919 -63 947 -64 963 -65 979 -67 1007 -68 1023 -69 1039 -71 1067 -72 1083 -73 1099 -75 1127 -76 1143 -77 1159 -79 1187 -80 1203 -81 1219 -83 1247 -84 1263 -85 1279 -87 1307 -88 1323 -89 1339 +10 152 +11 168 +12 184 +14 212 +15 228 +16 244 +18 272 +19 288 +20 304 +22 332 +23 348 +24 364 +26 392 +27 408 +28 424 +30 452 +31 468 +32 484 +34 512 +35 528 +36 544 +38 572 +39 588 +40 604 +42 632 +43 648 +44 664 +46 692 +47 708 +48 724 +50 752 +51 768 +52 784 +54 812 +55 828 +56 844 +58 872 +59 888 +60 904 +62 932 +63 948 +64 964 +66 992 +67 1008 +68 1024 +70 1052 +71 1068 +72 1084 +74 1112 +75 1128 +76 1144 +78 1172 +79 1188 +80 1204 +82 1232 +83 1248 +84 1264 +86 1292 +87 1308 +88 1324 +90 1352 +91 1368 +92 1384 +94 1412 +95 1428 +96 1444 +98 1472 +99 1488 +100 1504 +102 1532 +103 1548 +104 1564 +106 1592 +107 1608 +108 1624 +110 1652 +111 1668 +112 1684 +114 1712 +115 1728 +116 1744 +118 1772 +119 1788 +120 1804 122 1832 123 1848 124 1864 126 1892 127 1908 128 1924 -130 1952 -131 1968 -132 1984 -134 2012 -135 2028 -136 2044 -138 2072 -139 2088 -140 2104 -142 2132 -143 2148 -144 2164 -146 2192 -147 2208 -148 2224 -150 2252 -151 2268 -152 2284 -154 2312 -155 2328 -156 2344 -158 2372 -159 2388 -160 2404 -162 2432 -163 2448 -164 2464 -166 2492 -167 2508 -168 2524 -170 2552 -171 2568 -172 2584 -174 2612 -175 2628 -176 2644 -178 2672 -179 2688 -180 2704 -182 2732 -183 2748 -184 2764 -SELECT COUNT(*) FROM test_wl5522.t1; -COUNT(*) -96 -SELECT SUM(c2) FROM test_wl5522.t1; -SUM(c2) -145278 -SHOW CREATE TABLE test_wl5522.t1; +SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) NOT NULL AUTO_INCREMENT, @@ -427,134 +303,121 @@ t1 CREATE TABLE `t1` ( KEY `idx1` (`c2`), KEY `idx2` (`c3`(512)), KEY `idx3` (`c4`(512)) -) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -INSERT IGNORE INTO test_wl5522.t1 VALUES -(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); -Warnings: -Warning 1265 Data truncated for column 'c2' at row 1 -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -COUNT(*) -256 -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; -DROP TABLE test_wl5522.t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; ERROR HY000: Index for table 't1' is corrupt; try to repair it SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; -ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); +ALTER TABLE t1 ADD INDEX idx(c1); Warnings: Warning 1814 Tablespace has been discarded for table `t1` SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,fil_space_create_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 11 't1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 11 'Generic error' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Got error 39 't1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 39 'Data structure corruption' from ./test/t1.ibd SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; -SELECT COUNT(*) FROM test_wl5522.t1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; ERROR HY000: Tablespace has been discarded for table `t1` restore: t1 .ibd and .cfg files SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -ERROR HY000: Internal error: Cannot reset LSNs in table `test_wl5522`.`t1` : Data structure corruption +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Cannot reset LSNs in table `test`.`t1` : Data structure corruption SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; unlink: t1.ibd unlink: t1.cfg -DROP DATABASE test_wl5522; set global innodb_monitor_disable = all; set global innodb_monitor_reset_all = all; set global innodb_monitor_enable = default; diff --git a/mysql-test/suite/innodb_zip/r/wl5522_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_zip.result index a8e06835d85..40b357e1b7f 100644 --- a/mysql-test/suite/innodb_zip/r/wl5522_zip.result +++ b/mysql-test/suite/innodb_zip/r/wl5522_zip.result @@ -1,4 +1,4 @@ -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; CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, @@ -6,29 +6,26 @@ b char(22), c varchar(255), KEY (b)) 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'), ('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 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; -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; +DROP TEMPORARY TABLE t; SELECT COUNT(*) FROM t1; COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf db.opt t1.frm t1.ibd @@ -47,14 +44,14 @@ COUNT(*) 1280 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -1459 Apa Filler........ -1454 Apa Filler........ -1449 Apa Filler........ +1276 Apa Filler........ +1271 Apa Filler........ +1266 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -1463 Evolution lsjndofiabsoibeg -1462 Devotion asdfuihknaskdf -1461 Cavalry ..asdasdfaeraf +1280 Evolution lsjndofiabsoibeg +1279 Devotion asdfuihknaskdf +1278 Cavalry ..asdasdfaeraf # Restarting server # Done restarting server # List before t1 DISCARD @@ -72,14 +69,14 @@ COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf db.opt t1.cfg t1.frm @@ -89,14 +86,14 @@ COUNT(*) 640 SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; a b c -819 Apa Filler........ -814 Apa Filler........ -809 Apa Filler........ +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ SELECT * FROM t1 ORDER BY a DESC LIMIT 3; a b c -823 Evolution lsjndofiabsoibeg -822 Devotion asdfuihknaskdf -821 Cavalry ..asdasdfaeraf +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf DROP TABLE t1; SET SESSION innodb_strict_mode=1; CREATE TABLE t1( @@ -112,18 +109,11 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; db.opt t1.frm t1.ibd FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; -COUNT(*) -16 backup: t1 db.opt t1.cfg @@ -153,11 +143,7 @@ DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; db.opt t1.frm t1.ibd @@ -174,8 +160,6 @@ UNLOCK TABLES; db.opt t1.frm t1.ibd -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -200,23 +184,14 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; -COUNT(*) -16 backup: t1 db.opt t1.cfg t1.frm t1.ibd UNLOCK TABLES; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -238,19 +213,10 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; -COUNT(*) -16 backup: t1 UNLOCK TABLES; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; DROP TABLE t1; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, @@ -279,39 +245,32 @@ c1 c2 2 1 3 1 4 1 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 1 13 1 14 1 15 1 16 1 -17 1 -18 1 -19 1 -20 1 unlink: t1.cfg DROP TABLE t1; SET GLOBAL innodb_file_per_table = 0; CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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 +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` int(11) NOT NULL AUTO_INCREMENT, `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`) -) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 FLUSH TABLES t1 FOR EXPORT; Warnings: Warning 1809 Table `test`.`t1` in system tablespace @@ -322,12 +281,7 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -335,41 +289,7 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), KEY `idx` (`c2`) -) ENGINE=InnoDB AUTO_INCREMENT=59 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 +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED FLUSH TABLES t1 FOR EXPORT; backup: t1 UNLOCK TABLES; @@ -447,42 +367,26 @@ t1 CREATE TABLE `t1` ( `c2` int(11) DEFAULT NULL, PRIMARY KEY (`c1`), 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 +5 1 6 1 7 1 8 1 9 1 +10 1 +11 1 +12 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 DROP TABLE t1; 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"); diff --git a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test index 5485fec3e7d..411d47118f6 100644 --- a/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test +++ b/mysql-test/suite/innodb_zip/t/wl5522_debug_zip.test @@ -12,70 +12,66 @@ --source include/innodb_page_size_small.inc --source include/default_charset.inc +--source include/have_sequence.inc -call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded."); -call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue."); -call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*"); +call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded\\."); +call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue\\."); +call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file"); call mtr.add_suppression("InnoDB: Page for tablespace "); call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x"); FLUSH TABLES; let MYSQLD_DATADIR =`SELECT @@datadir`; -let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/; SET SESSION innodb_strict_mode=1; -CREATE DATABASE test_wl5522; - # Create the table that we will use for crash recovery (during IMPORT) -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); - ---replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ +INSERT INTO t1 VALUES (1), (2), (3), (4); -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -INSERT INTO test_wl5522.t1 VALUES (1); +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_discard_tablespaces("test_wl5522", "t1"); +ib_discard_tablespaces("test", "t1"); EOF --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF ##### Before commit crash SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; --error ER_TABLESPACE_DISCARDED -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; # Write file to make mysql-test-run.pl start up the server again --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Execute the statement that causes the crash --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; --enable_reconnect --source include/wait_until_connected_again.inc @@ -89,14 +85,14 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Don't start up the server right away. --exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect # Execute the statement that causes the crash --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # After the above test the results are non-deterministic, # delete the old tablespace files and drop the table, @@ -104,7 +100,7 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -- source include/wait_until_disconnected.inc perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF --echo # Restart and reconnect to the server @@ -118,95 +114,91 @@ EOF # After the above test the results are non-deterministic, recreate the table # and do a proper import. -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET SESSION innodb_strict_mode=1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; -INSERT INTO test_wl5522.t1 VALUES(400), (500), (600); +INSERT INTO t1 VALUES(400), (500), (600); -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test handling of internal failure error -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_import_internal_error"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test failure after reset of space id and LSN in the tablespace -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb +CREATE TABLE t1 (c1 INT) ENGINE = Innodb ROW_FORMAT=COMPRESSED; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug=@saved_debug_dbug; @@ -214,16 +206,16 @@ SET SESSION debug_dbug=@saved_debug_dbug; # Test failure after attempting a tablespace open SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ---replace_regex /'.*[\/\\]/'/ +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after ibuf check @@ -231,73 +223,73 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; # Need proper mapping of error codes :-( --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after adjusting the cluster index root page SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_cluster_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the secondary index(es) SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Left over from the failed IMPORT perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -DROP TABLE test_wl5522.t1; +DROP TABLE t1; --disable_query_log # Enable metrics for the counters we are going to use @@ -311,7 +303,7 @@ set global innodb_monitor_enable = ibuf_merges_insert; # Create a large table with delete marked records, disable purge during # the update so that we can test the IMPORT purge code. # -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -332,64 +324,45 @@ SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; -INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES - (1, REPEAT('a', 2048), REPEAT('a', 2048)), - (2, REPEAT('b', 2048), REPEAT('b', 2048)), - (3, REPEAT('c', 2048), REPEAT('c', 2048)), - (4, REPEAT('d', 2048), REPEAT('d', 2048)); +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; +DELETE FROM t1 WHERE c2 = 1; -DELETE FROM test_wl5522.t1 WHERE c2 = 1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024); -UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024); +SHOW CREATE TABLE t1; -SHOW CREATE TABLE test_wl5522.t1; - -SELECT c1, c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; - -SELECT name - FROM information_schema.innodb_metrics - WHERE name = 'ibuf_merges_insert' AND count = 0; - -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -SELECT name - FROM information_schema.innodb_metrics - WHERE name = 'ibuf_merges' AND count > 0; - -SELECT name - FROM information_schema.innodb_metrics - WHERE name = 'ibuf_merges_inserts' AND count > 0; +SELECT name FROM information_schema.innodb_metrics +WHERE name IN ('ibuf_merges','ibuf_merges_insert') AND count>0 ORDER BY name; SET GLOBAL innodb_disable_background_merge=OFF; @@ -399,9 +372,9 @@ COMMIT; disconnect purge_control; connection default; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -411,296 +384,272 @@ CREATE TABLE test_wl5522.t1 ( INDEX idx3(c4(512))) Engine=InnoDB ROW_FORMAT=COMPRESSED; -SELECT c1, c2 FROM test_wl5522.t1; +SELECT c1, c2 FROM t1; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT c1,c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; +SELECT c1,c2 FROM t1; -SHOW CREATE TABLE test_wl5522.t1; +SHOW CREATE TABLE t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; #### # Create a table and save the tablespace and .cfg file, we need to create # a Btree that has several levels -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -INSERT IGNORE INTO test_wl5522.t1 VALUES - (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); - -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - # Following alter is failing --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; ---replace_regex $pathfix - --error ER_INNODB_INDEX_CORRUPT -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; -ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); +ALTER TABLE t1 ADD INDEX idx(c1); SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fil_space_create_failure"; ---replace_regex /'.*[\/\\]/'/ +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ---replace_regex /'.*[\/\\]/'/ +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; ---replace_regex /'.*t1.cfg'/'t1.cfg'/ - --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF - -DROP DATABASE test_wl5522; - set global innodb_monitor_disable = all; set global innodb_monitor_reset_all = all; @@ -717,18 +666,16 @@ call mtr.add_suppression("Monitor ibuf_merges is already enabled"); call mtr.add_suppression("Monitor ibuf_merges_insert is already enabled"); call mtr.add_suppression("Got error -1 when reading table '.*'"); call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded."); -call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache.*"); +call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache"); call mtr.add_suppression("InnoDB: Freeing existing tablespace '.*' entry from the cache with id.*"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); -call mtr.add_suppression(".*There was an error writing to the meta data file.*"); +call mtr.add_suppression("There was an error writing to the meta data file"); call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file"); call mtr.add_suppression("Unsupported tablespace format"); -call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\""); call mtr.add_suppression("Page is marked as free"); call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted"); call mtr.add_suppression("but tablespace with that id or name does not exist"); -call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache"); -call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'"); +call mtr.add_suppression("Could not find a valid tablespace file for '.*t1'"); call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it"); --enable_query_log diff --git a/mysql-test/suite/innodb_zip/t/wl5522_zip.test b/mysql-test/suite/innodb_zip/t/wl5522_zip.test index d92093262ac..d5e6bc6e725 100644 --- a/mysql-test/suite/innodb_zip/t/wl5522_zip.test +++ b/mysql-test/suite/innodb_zip/t/wl5522_zip.test @@ -2,8 +2,9 @@ --source include/not_embedded.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; @@ -17,17 +18,14 @@ CREATE TABLE t1 KEY (b)) 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'), ('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 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; -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; +DROP TEMPORARY TABLE t; SELECT COUNT(*) FROM t1; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3; @@ -89,16 +87,11 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -140,11 +133,7 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; @@ -159,9 +148,6 @@ UNLOCK TABLES; --list_files $MYSQLD_DATADIR/test # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -195,14 +181,9 @@ CREATE TABLE t1( c2 INT, INDEX(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -211,9 +192,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -250,14 +228,9 @@ eval CREATE TABLE t1( c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE; -INSERT INTO t1(c2) VALUES(1); -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 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -265,9 +238,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; --replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16 @@ -319,14 +289,7 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -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; - +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; # This should fail, InnoDB should return a warning @@ -347,15 +310,9 @@ CREATE TABLE t1( c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -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; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -511,7 +468,7 @@ SELECT * FROM t1; DROP TABLE t1; 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"); # cleanup |