Commit 6a524fcf authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14140 IMPORT TABLESPACE must not go beyond FSP_FREE_LIMIT

ibuf_check_bitmap_on_import(): Only access the pages that
are below FSP_FREE_LIMIT. It is possible that especially with
ROW_FORMAT=COMPRESSED, the FSP_SIZE will be much bigger than
the FSP_FREE_LIMIT, and the bitmap pages (page_size*N, 1+page_size*N)
are filled with zero bytes.

buf_page_is_corrupted(), buf_page_io_complete(): Make the
fault injection compatible with MariaDB 10.2.

Backport the IMPORT tests from 10.2.
parent bfde65c0
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
DROP DATABASE IF EXISTS test_wl5522;
Warnings:
Note 1008 Can't drop database 'test_wl5522'; database doesn't exist
CREATE DATABASE test_wl5522; CREATE DATABASE test_wl5522;
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
SET SESSION debug_dbug="-d,ib_discard_before_commit_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
SET SESSION debug_dbug="-d,ib_discard_after_commit_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
SET GLOBAL innodb_file_per_table = 1; 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; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);
FLUSH TABLES test_wl5522.t1 FOR EXPORT; FLUSH TABLES test_wl5522.t1 FOR EXPORT;
...@@ -40,21 +26,18 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ...@@ -40,21 +26,18 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
SELECT * FROM test_wl5522.t1; SELECT * FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table '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 test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
SET SESSION debug_dbug="-d,ib_import_before_commit_crash";
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table '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 test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
# Restart and reconnect to the server
SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table; SELECT @@innodb_file_per_table;
...@@ -83,13 +66,14 @@ c1 ...@@ -83,13 +66,14 @@ c1
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_export_io_write_failure_1"; SET SESSION debug_dbug="+d,ib_export_io_write_failure_1";
FLUSH TABLES test_wl5522.t1 FOR EXPORT; FLUSH TABLES test_wl5522.t1 FOR EXPORT;
Warnings: 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -99,7 +83,7 @@ Warnings: ...@@ -99,7 +83,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -109,7 +93,7 @@ Warnings: ...@@ -109,7 +93,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -119,7 +103,7 @@ Warnings: ...@@ -119,7 +103,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -129,7 +113,7 @@ Warnings: ...@@ -129,7 +113,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -139,7 +123,7 @@ Warnings: ...@@ -139,7 +123,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -149,7 +133,7 @@ Warnings: ...@@ -149,7 +133,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -159,7 +143,7 @@ Warnings: ...@@ -159,7 +143,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -169,7 +153,7 @@ Warnings: ...@@ -169,7 +153,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -179,7 +163,7 @@ Warnings: ...@@ -179,7 +163,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_10"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -189,7 +173,7 @@ Warnings: ...@@ -189,7 +173,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_11"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -199,7 +183,7 @@ Warnings: ...@@ -199,7 +183,7 @@ 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 flush() failed
Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed Warning 1811 IO Write error: (9, Bad file descriptor) t1.cfg flose() failed
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_12"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (100), (200), (300); INSERT INTO test_wl5522.t1 VALUES (100), (200), (300);
...@@ -219,7 +203,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_1"; ...@@ -219,7 +203,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_1";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading index fields. ERROR HY000: IO Read error: while reading index fields.
SET SESSION debug_dbug="-d,ib_import_io_read_error_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -230,7 +214,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_2"; ...@@ -230,7 +214,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_2";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading index meta-data, expected to read 44 bytes but read only 0 bytes ERROR HY000: IO Read error: while reading index meta-data, expected to read 44 bytes but read only 0 bytes
SET SESSION debug_dbug="-d,ib_import_io_read_error_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -241,7 +225,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_3"; ...@@ -241,7 +225,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_3";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading number of indexes. ERROR HY000: IO Read error: while reading number of indexes.
SET SESSION debug_dbug="-d,ib_import_io_read_error_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -252,7 +236,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_4"; ...@@ -252,7 +236,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_4";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading table column meta-data. ERROR HY000: IO Read error: while reading table column meta-data.
SET SESSION debug_dbug="-d,ib_import_io_read_error_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -263,7 +247,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_5"; ...@@ -263,7 +247,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_5";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading meta-data export hostname length. ERROR HY000: IO Read error: while reading meta-data export hostname length.
SET SESSION debug_dbug="-d,ib_import_io_read_error_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -274,7 +258,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_6"; ...@@ -274,7 +258,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_6";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading meta-data table name length. ERROR HY000: IO Read error: while reading meta-data table name length.
SET SESSION debug_dbug="-d,ib_import_io_read_error_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -285,7 +269,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_7"; ...@@ -285,7 +269,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_7";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading autoinc value. ERROR HY000: IO Read error: while reading autoinc value.
SET SESSION debug_dbug="-d,ib_import_io_read_error_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -296,7 +280,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_8"; ...@@ -296,7 +280,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_8";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading meta-data header. ERROR HY000: IO Read error: while reading meta-data header.
SET SESSION debug_dbug="-d,ib_import_io_read_error_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -307,7 +291,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_9"; ...@@ -307,7 +291,7 @@ SET SESSION debug_dbug="+d,ib_import_io_read_error_9";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while reading meta-data version. ERROR HY000: IO Read error: while reading meta-data version.
SET SESSION debug_dbug="-d,ib_import_io_read_error_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -318,7 +302,7 @@ SET SESSION debug_dbug="+d,ib_import_string_read_error"; ...@@ -318,7 +302,7 @@ SET SESSION debug_dbug="+d,ib_import_string_read_error";
restore: t1 .cfg file restore: t1 .cfg file
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: IO Read error: while parsing export hostname. ERROR HY000: IO Read error: while parsing export hostname.
SET SESSION debug_dbug="-d,ib_import_string_read_error"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
...@@ -329,7 +313,7 @@ restore: t1 .ibd and .cfg files ...@@ -329,7 +313,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_1"; SET SESSION debug_dbug="+d,ib_import_OOM_1";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -342,7 +326,7 @@ restore: t1 .ibd and .cfg files ...@@ -342,7 +326,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_2"; SET SESSION debug_dbug="+d,ib_import_OOM_2";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -355,7 +339,7 @@ restore: t1 .ibd and .cfg files ...@@ -355,7 +339,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_4"; SET SESSION debug_dbug="+d,ib_import_OOM_4";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -368,7 +352,7 @@ restore: t1 .ibd and .cfg files ...@@ -368,7 +352,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_5"; SET SESSION debug_dbug="+d,ib_import_OOM_5";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -381,7 +365,7 @@ restore: t1 .ibd and .cfg files ...@@ -381,7 +365,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_6"; SET SESSION debug_dbug="+d,ib_import_OOM_6";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -394,7 +378,7 @@ restore: t1 .ibd and .cfg files ...@@ -394,7 +378,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_7"; SET SESSION debug_dbug="+d,ib_import_OOM_7";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -407,7 +391,7 @@ restore: t1 .ibd and .cfg files ...@@ -407,7 +391,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_8"; SET SESSION debug_dbug="+d,ib_import_OOM_8";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -420,7 +404,7 @@ restore: t1 .ibd and .cfg files ...@@ -420,7 +404,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_9"; SET SESSION debug_dbug="+d,ib_import_OOM_9";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -433,7 +417,7 @@ restore: t1 .ibd and .cfg files ...@@ -433,7 +417,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_OOM_10"; SET SESSION debug_dbug="+d,ib_import_OOM_10";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.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 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="-d,ib_import_OOM_10"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -445,7 +429,7 @@ restore: t1 .ibd and .cfg files ...@@ -445,7 +429,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_internal_error"; SET SESSION debug_dbug="+d,ib_import_internal_error";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error
SET SESSION debug_dbug="-d,ib_import_internal_error"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -458,36 +442,36 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; ...@@ -458,36 +442,36 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 44 'Tablespace not found' from ./test_wl5522/t1.ibd ERROR HY000: Got error 44 'Tablespace not found' from ./test_wl5522/t1.ibd
SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_failure"; SET SESSION debug_dbug="+d,ib_import_cluster_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_cluster_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -499,7 +483,7 @@ c4 VARCHAR(2048), ...@@ -499,7 +483,7 @@ c4 VARCHAR(2048),
INDEX idx1(c2), INDEX idx1(c2),
INDEX idx2(c3(512)), INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB; INDEX idx3(c4(512))) Engine=InnoDB;
SET GLOBAL INNODB_PURGE_STOP_NOW=ON; START TRANSACTION WITH CONSISTENT SNAPSHOT;
SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
...@@ -664,7 +648,7 @@ FROM information_schema.innodb_metrics ...@@ -664,7 +648,7 @@ FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_inserts' AND count > 0; WHERE name = 'ibuf_merges_inserts' AND count > 0;
name name
SET GLOBAL innodb_disable_background_merge=OFF; SET GLOBAL innodb_disable_background_merge=OFF;
SET GLOBAL INNODB_PURGE_RUN_NOW=ON; COMMIT;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 ( CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...@@ -800,8 +784,8 @@ t1 CREATE TABLE `t1` ( ...@@ -800,8 +784,8 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731));
Warnings: Warnings:
Warning 1265 Data truncated for column 'c2' at row 1 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;
...@@ -827,7 +811,7 @@ restore: t1 .ibd and .cfg files ...@@ -827,7 +811,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -836,10 +820,10 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ...@@ -836,10 +820,10 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug="-d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -851,7 +835,7 @@ restore: t1 .ibd and .cfg files ...@@ -851,7 +835,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index "GEN_CLUST_INDEX" 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="-d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -863,7 +847,7 @@ restore: t1 .ibd and .cfg files ...@@ -863,7 +847,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -875,7 +859,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; ...@@ -875,7 +859,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
Warnings: Warnings:
Warning 1814 Tablespace has been discarded for table 't1' Warning 1814 Tablespace has been discarded for table 't1'
SET SESSION debug_dbug="-d,ib_import_create_index_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -887,7 +871,7 @@ restore: t1 .ibd and .cfg files ...@@ -887,7 +871,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fil_space_create_failure"; SET SESSION debug_dbug="+d,fil_space_create_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 11 'Generic error' from ./test_wl5522/t1.ibd ERROR HY000: Got error 11 'Generic error' from ./test_wl5522/t1.ibd
SET SESSION debug_dbug="-d,fil_space_create_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -899,7 +883,7 @@ restore: t1 .ibd and .cfg files ...@@ -899,7 +883,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 39 'Data structure corruption' from ./test_wl5522/t1.ibd ERROR HY000: Got error 39 'Data structure corruption' from ./test_wl5522/t1.ibd
SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -911,7 +895,7 @@ restore: t1 .ibd and .cfg files ...@@ -911,7 +895,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
......
# Not supported in embedded # mysql-test-run.pl --embedded cannot restart the server.
--source include/not_embedded.inc --source include/not_embedded.inc
# Adding big test option for this test. # Adding big test option for this test.
...@@ -21,58 +21,39 @@ let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/; ...@@ -21,58 +21,39 @@ let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/;
let $strerrfix=/ (\(.+\))//; let $strerrfix=/ (\(.+\))//;
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
DROP DATABASE IF EXISTS test_wl5522;
CREATE DATABASE test_wl5522; CREATE DATABASE test_wl5522;
##### Before DISCARD commit crash
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);
# Write file to make mysql-test-run.pl start up the server again --let $_server_id= `SELECT @@server_id`
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
# Execute the statement that causes the crash --exec echo wait > $_expect_file_name
SET SESSION debug_dbug="+d,ib_discard_before_commit_crash";
--error 2013 --error 2013
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--enable_reconnect --source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
SET SESSION debug_dbug="-d,ib_discard_before_commit_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
#### Before DISCARD commit crash
##### After DISCARD commit crash
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);
# Write file to make mysql-test-run.pl start up the server again --exec echo wait > $_expect_file_name
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect SET SESSION debug_dbug="+d,ib_discard_after_commit_crash";
# Execute the statement that causes the crash
--error 2013 --error 2013
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
--enable_reconnect --source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
SET SESSION debug_dbug="-d,ib_discard_after_commit_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
#### After DISCARD commit crash
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
# Create the table that we will use for crash recovery (during IMPORT) # Create the table that we will use for crash recovery (during IMPORT)
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
...@@ -104,61 +85,35 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ...@@ -104,61 +85,35 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
##### Before commit crash
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
--error ER_TABLESPACE_DISCARDED --error ER_TABLESPACE_DISCARDED
SELECT * FROM test_wl5522.t1; SELECT * FROM test_wl5522.t1;
# Write file to make mysql-test-run.pl start up the server again --exec echo wait > $_expect_file_name
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
# Execute the statement that causes the crash
--error 2013 --error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
--enable_reconnect --source include/start_mysqld.inc
--source include/wait_until_connected_again.inc
--disable_reconnect
SET SESSION debug_dbug="-d,ib_import_before_commit_crash";
#### Before commit crash
# Check that the DD is consistent after recovery # Check that the DD is consistent after recovery
##### Before checkpoint crash
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
--error ER_TABLESPACE_DISCARDED --error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
# Don't start up the server right away. --exec echo wait > $_expect_file_name
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
# Execute the statement that causes the crash
--error 2013 --error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
# After the above test the results are non-deterministic, # After the above test the results are non-deterministic,
# delete the old tablespace files and drop the table, # delete the old tablespace files and drop the table,
# recreate the table and do a proper import. # recreate the table and do a proper import.
-- source include/wait_until_disconnected.inc
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
--echo # Restart and reconnect to the server --source include/start_mysqld.inc
--enable_reconnect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect
SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash";
#### Before checkpoint crash
# After the above test the results are non-deterministic, recreate the table
# and do a proper import.
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -190,6 +145,7 @@ DROP TABLE test_wl5522.t1; ...@@ -190,6 +145,7 @@ DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1); INSERT INTO test_wl5522.t1 VALUES (1);
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_export_io_write_failure_1"; SET SESSION debug_dbug="+d,ib_export_io_write_failure_1";
--replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/
...@@ -198,7 +154,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -198,7 +154,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -214,7 +170,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -214,7 +170,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -229,7 +185,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -229,7 +185,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -244,7 +200,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -244,7 +200,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -259,7 +215,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -259,7 +215,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -275,7 +231,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -275,7 +231,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -291,7 +247,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -291,7 +247,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -307,7 +263,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -307,7 +263,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -322,7 +278,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -322,7 +278,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -338,7 +294,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -338,7 +294,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_10"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -354,7 +310,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -354,7 +310,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_11"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -370,7 +326,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT; ...@@ -370,7 +326,7 @@ FLUSH TABLES test_wl5522.t1 FOR EXPORT;
UNLOCK TABLES; UNLOCK TABLES;
SET SESSION debug_dbug="-d,ib_export_io_write_failure_12"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -410,7 +366,7 @@ EOF ...@@ -410,7 +366,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -434,7 +390,7 @@ EOF ...@@ -434,7 +390,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -458,7 +414,7 @@ EOF ...@@ -458,7 +414,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -482,7 +438,7 @@ EOF ...@@ -482,7 +438,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -506,7 +462,7 @@ EOF ...@@ -506,7 +462,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -530,7 +486,7 @@ EOF ...@@ -530,7 +486,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -554,7 +510,7 @@ EOF ...@@ -554,7 +510,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -578,7 +534,7 @@ EOF ...@@ -578,7 +534,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -602,7 +558,7 @@ EOF ...@@ -602,7 +558,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_io_read_error_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -627,7 +583,7 @@ EOF ...@@ -627,7 +583,7 @@ EOF
--error ER_IO_READ_ERROR --error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_string_read_error"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -654,7 +610,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_1"; ...@@ -654,7 +610,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_1";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -686,7 +642,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_2"; ...@@ -686,7 +642,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_2";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -718,7 +674,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_4"; ...@@ -718,7 +674,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_4";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_4"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -750,7 +706,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_5"; ...@@ -750,7 +706,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_5";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_5"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -781,7 +737,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_6"; ...@@ -781,7 +737,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_6";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_6"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -811,7 +767,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_7"; ...@@ -811,7 +767,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_7";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_7"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -841,7 +797,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_8"; ...@@ -841,7 +797,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_8";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_8"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -871,7 +827,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_9"; ...@@ -871,7 +827,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_9";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_9"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -901,7 +857,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_10"; ...@@ -901,7 +857,7 @@ SET SESSION debug_dbug="+d,ib_import_OOM_10";
--error ER_OUT_OF_RESOURCES --error ER_OUT_OF_RESOURCES
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_OOM_10"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -933,7 +889,7 @@ SET SESSION debug_dbug="+d,ib_import_internal_error"; ...@@ -933,7 +889,7 @@ SET SESSION debug_dbug="+d,ib_import_internal_error";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_internal_error"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -974,7 +930,7 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ...@@ -974,7 +930,7 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Test failure after attempting a tablespace open # Test failure after attempting a tablespace open
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
...@@ -984,7 +940,7 @@ SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ...@@ -984,7 +940,7 @@ SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -999,7 +955,7 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; ...@@ -999,7 +955,7 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -1013,7 +969,7 @@ SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; ...@@ -1013,7 +969,7 @@ SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -1027,7 +983,7 @@ SET SESSION debug_dbug="+d,ib_import_cluster_failure"; ...@@ -1027,7 +983,7 @@ SET SESSION debug_dbug="+d,ib_import_cluster_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_cluster_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -1041,7 +997,7 @@ SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; ...@@ -1041,7 +997,7 @@ SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
...@@ -1055,7 +1011,7 @@ SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; ...@@ -1055,7 +1011,7 @@ SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Left over from the failed IMPORT # Left over from the failed IMPORT
perl; perl;
...@@ -1087,7 +1043,9 @@ CREATE TABLE test_wl5522.t1 ( ...@@ -1087,7 +1043,9 @@ CREATE TABLE test_wl5522.t1 (
INDEX idx3(c4(512))) Engine=InnoDB; INDEX idx3(c4(512))) Engine=InnoDB;
# Stop purge so that it doesn't remove the delete marked entries. # Stop purge so that it doesn't remove the delete marked entries.
SET GLOBAL INNODB_PURGE_STOP_NOW=ON; connect (purge_control,localhost,root);
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
# Disable change buffer merge from the master thread, additionally # Disable change buffer merge from the master thread, additionally
# enable aggressive flushing so that more changes are buffered. # enable aggressive flushing so that more changes are buffered.
...@@ -1157,7 +1115,10 @@ SELECT name ...@@ -1157,7 +1115,10 @@ SELECT name
SET GLOBAL innodb_disable_background_merge=OFF; SET GLOBAL innodb_disable_background_merge=OFF;
# Enable normal operation # Enable normal operation
SET GLOBAL INNODB_PURGE_RUN_NOW=ON; connection purge_control;
COMMIT;
disconnect purge_control;
connection default;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1195,8 +1156,8 @@ DROP TABLE test_wl5522.t1; ...@@ -1195,8 +1156,8 @@ DROP TABLE test_wl5522.t1;
# a Btree that has several levels # a Btree that has several levels
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); (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;
...@@ -1238,7 +1199,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; ...@@ -1238,7 +1199,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1262,14 +1223,14 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ...@@ -1262,14 +1223,14 @@ do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
SET SESSION debug_dbug="+d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/ --replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1299,7 +1260,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; ...@@ -1299,7 +1260,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
--error ER_INNODB_INDEX_CORRUPT --error ER_INNODB_INDEX_CORRUPT
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1329,7 +1290,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; ...@@ -1329,7 +1290,7 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1349,7 +1310,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; ...@@ -1349,7 +1310,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
SET SESSION debug_dbug="-d,ib_import_create_index_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1380,7 +1341,7 @@ SET SESSION debug_dbug="+d,fil_space_create_failure"; ...@@ -1380,7 +1341,7 @@ SET SESSION debug_dbug="+d,fil_space_create_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,fil_space_create_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1411,7 +1372,7 @@ SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ...@@ -1411,7 +1372,7 @@ SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1442,7 +1403,7 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; ...@@ -1442,7 +1403,7 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -1491,4 +1452,3 @@ call mtr.add_suppression("while reading index meta-data, expected to read 44 byt ...@@ -1491,4 +1452,3 @@ call mtr.add_suppression("while reading index meta-data, expected to read 44 byt
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd --remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd
eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table; eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;
call mtr.add_suppression("InnoDB: Page for tablespace .* "); call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoSB: Warning: database page corruption or a failed .*"); 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; FLUSH TABLES;
SET GLOBAL innodb_file_per_table = 1; SET GLOBAL innodb_file_per_table=1;
SELECT @@innodb_file_per_table; SET GLOBAL innodb_file_format=Barracuda;
@@innodb_file_per_table
1
SET GLOBAL innodb_file_format = `Barracuda`;
SELECT @@innodb_file_format;
@@innodb_file_format
Barracuda
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
SELECT @@SESSION.innodb_strict_mode;
@@SESSION.innodb_strict_mode
1
DROP DATABASE IF EXISTS test_wl5522;
Warnings:
Note 1008 Can't drop database 'test_wl5522'; database doesn't exist
CREATE DATABASE test_wl5522; CREATE DATABASE test_wl5522;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
...@@ -36,7 +27,6 @@ SELECT * FROM test_wl5522.t1; ...@@ -36,7 +27,6 @@ SELECT * FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Lost connection to MySQL server during query ERROR HY000: Lost connection to MySQL server during query
SET SESSION debug_dbug="-d,ib_import_before_commit_crash";
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
...@@ -45,20 +35,12 @@ ERROR HY000: Lost connection to MySQL server during query ...@@ -45,20 +35,12 @@ ERROR HY000: Lost connection to MySQL server during query
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
# Restart and reconnect to the server # Restart and reconnect to the server
SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
@@innodb_file_per_table
1
SET GLOBAL innodb_file_format = `Barracuda`;
SELECT @@innodb_file_format;
@@innodb_file_format
Barracuda
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
SELECT @@SESSION.innodb_strict_mode; SET @file_per_table = @@GLOBAL.innodb_file_per_table;
@@SESSION.innodb_strict_mode SET @file_format = @@GLOBAL.innodb_file_format;
1 SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_file_format=Barracuda;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
...@@ -87,10 +69,11 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ...@@ -87,10 +69,11 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_import_internal_error"; SET SESSION debug_dbug="+d,ib_import_internal_error";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error ERROR HY000: Internal error: While updating the <space, root page number> of index "GEN_CLUST_INDEX" - Generic error
SET SESSION debug_dbug="-d,ib_import_internal_error"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -104,36 +87,36 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; ...@@ -104,36 +87,36 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Too many concurrent transactions
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 44 't1.ibd ERROR HY000: Got error 44 't1.ibd
SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_cluster_failure"; SET SESSION debug_dbug="+d,ib_import_cluster_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_cluster_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -145,8 +128,8 @@ c4 VARCHAR(2048), ...@@ -145,8 +128,8 @@ c4 VARCHAR(2048),
INDEX idx1(c2), INDEX idx1(c2),
INDEX idx2(c3(512)), INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ROW_FORMAT=COMPRESSED;
SET GLOBAL INNODB_PURGE_STOP_NOW=ON; START TRANSACTION WITH CONSISTENT SNAPSHOT;
SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
...@@ -189,7 +172,7 @@ t1 CREATE TABLE `t1` ( ...@@ -189,7 +172,7 @@ t1 CREATE TABLE `t1` (
KEY `idx1` (`c2`), KEY `idx1` (`c2`),
KEY `idx2` (`c3`(512)), KEY `idx2` (`c3`(512)),
KEY `idx3` (`c4`(512)) KEY `idx3` (`c4`(512))
) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 ) ENGINE=InnoDB AUTO_INCREMENT=248 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
SELECT c1, c2 FROM test_wl5522.t1; SELECT c1, c2 FROM test_wl5522.t1;
c1 c2 c1 c2
2 32 2 32
...@@ -311,7 +294,7 @@ FROM information_schema.innodb_metrics ...@@ -311,7 +294,7 @@ FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_inserts' AND count > 0; WHERE name = 'ibuf_merges_inserts' AND count > 0;
name name
SET GLOBAL innodb_disable_background_merge=OFF; SET GLOBAL innodb_disable_background_merge=OFF;
SET GLOBAL INNODB_PURGE_RUN_NOW=ON; COMMIT;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 ( CREATE TABLE test_wl5522.t1 (
c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
...@@ -321,7 +304,7 @@ c4 VARCHAR(2048), ...@@ -321,7 +304,7 @@ c4 VARCHAR(2048),
INDEX idx1(c2), INDEX idx1(c2),
INDEX idx2(c3(512)), INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ROW_FORMAT=COMPRESSED;
SELECT c1, c2 FROM test_wl5522.t1; SELECT c1, c2 FROM test_wl5522.t1;
c1 c2 c1 c2
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
...@@ -445,11 +428,11 @@ t1 CREATE TABLE `t1` ( ...@@ -445,11 +428,11 @@ t1 CREATE TABLE `t1` (
KEY `idx1` (`c2`), KEY `idx1` (`c2`),
KEY `idx2` (`c3`(512)), KEY `idx2` (`c3`(512)),
KEY `idx3` (`c4`(512)) KEY `idx3` (`c4`(512))
) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8 ) ENGINE=InnoDB AUTO_INCREMENT=185 DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO test_wl5522.t1 VALUES INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200));
Warnings: Warnings:
Warning 1265 Data truncated for column 'c2' at row 1 Warning 1265 Data truncated for column 'c2' at row 1
...@@ -477,7 +460,7 @@ restore: t1 .ibd and .cfg files ...@@ -477,7 +460,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -487,9 +470,10 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ...@@ -487,9 +470,10 @@ ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
SELECT COUNT(*) FROM test_wl5522.t1; SELECT COUNT(*) FROM test_wl5522.t1;
ERROR HY000: Tablespace has been discarded for table 't1' ERROR HY000: Tablespace has been discarded for table 't1'
restore: t1 .ibd and .cfg files restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,buf_page_is_corrupt_failure"; ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Data structure corruption
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -502,7 +486,7 @@ restore: t1 .ibd and .cfg files ...@@ -502,7 +486,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index "GEN_CLUST_INDEX" 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="-d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -515,7 +499,7 @@ restore: t1 .ibd and .cfg files ...@@ -515,7 +499,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Incorrect key file for table 't1'; try to repair it ERROR HY000: Incorrect key file for table 't1'; try to repair it
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -528,7 +512,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; ...@@ -528,7 +512,7 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
Warnings: Warnings:
Warning 1814 Tablespace has been discarded for table 't1' Warning 1814 Tablespace has been discarded for table 't1'
SET SESSION debug_dbug="-d,ib_import_create_index_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -541,7 +525,7 @@ restore: t1 .ibd and .cfg files ...@@ -541,7 +525,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fil_space_create_failure"; SET SESSION debug_dbug="+d,fil_space_create_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 11 't1.ibd ERROR HY000: Got error 11 't1.ibd
SET SESSION debug_dbug="-d,fil_space_create_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -554,7 +538,7 @@ restore: t1 .ibd and .cfg files ...@@ -554,7 +538,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Got error 39 't1.ibd ERROR HY000: Got error 39 't1.ibd
SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -567,7 +551,7 @@ restore: t1 .ibd and .cfg files ...@@ -567,7 +551,7 @@ restore: t1 .ibd and .cfg files
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported ERROR HY000: Internal error: Cannot reset LSNs in table '"test_wl5522"."t1"' : Unsupported
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
unlink: t1.ibd unlink: t1.ibd
unlink: t1.cfg unlink: t1.cfg
...@@ -578,6 +562,5 @@ set global innodb_monitor_enable = default; ...@@ -578,6 +562,5 @@ set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default; set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default; set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default; set global innodb_monitor_reset_all = default;
SET GLOBAL INNODB_FILE_PER_TABLE=1; SET GLOBAL innodb_file_per_table = @file_per_table;
SET GLOBAL INNODB_FILE_FORMAT=Antelope; SET GLOBAL innodb_file_format = @file_format;
SET SESSION innodb_strict_mode=0;
# Not supported in embedded # mysql-test-run.pl --embedded cannot restart the server.
--source include/not_embedded.inc --source include/not_embedded.inc
# This test case needs to crash the server. Needs a debug server. # This test case needs to crash the server. Needs a debug server.
--source include/have_debug.inc --source include/have_debug.inc
# Don't test this under valgrind, memory leaks will occur. # Valgrind can hang or return spurious messages on DBUG_SUICIDE
--source include/not_valgrind.inc --source include/not_valgrind.inc
# Avoid CrashReporter popup on Mac # Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc --source include/not_crashrep.inc
-- source include/have_innodb.inc -- source include/innodb_page_size_small.inc
# compressed table in tests are with sizes KEY_BLOCK_SIZE 1,2,4,8,16 call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
# Table creatation fails if KEY_BLOCK_SIZE > innodb-page-size,so 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.");
# allow test to run only when innodb-page-size=16 call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
--source include/have_innodb_16k.inc call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
# Test intentionally crashes the server, corrupted pages possible
call mtr.add_suppression("InnoDB: Page for tablespace .* ");
call mtr.add_suppression("InnoSB: Warning: database page corruption or a failed .*");
FLUSH TABLES; FLUSH TABLES;
SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_file_format=Barracuda;
let MYSQLD_DATADIR =`SELECT @@datadir`; let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
let $innodb_file_format = `SELECT @@innodb_file_format`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/; let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
SET GLOBAL innodb_file_format = `Barracuda`;
SELECT @@innodb_file_format;
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
SELECT @@SESSION.innodb_strict_mode;
DROP DATABASE IF EXISTS test_wl5522;
CREATE DATABASE test_wl5522; CREATE DATABASE test_wl5522;
# Create the table that we will use for crash recovery (during IMPORT) # Create the table that we will use for crash recovery (during IMPORT)
...@@ -52,7 +39,7 @@ INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); ...@@ -52,7 +39,7 @@ INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);
FLUSH TABLES test_wl5522.t1 FOR EXPORT; FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1"); ib_backup_tablespaces("test_wl5522", "t1");
EOF EOF
UNLOCK TABLES; UNLOCK TABLES;
...@@ -66,7 +53,7 @@ INSERT INTO test_wl5522.t1 VALUES (1); ...@@ -66,7 +53,7 @@ INSERT INTO test_wl5522.t1 VALUES (1);
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test_wl5522", "t1"); ib_discard_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -75,7 +62,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -75,7 +62,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -96,7 +83,6 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ...@@ -96,7 +83,6 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--disable_reconnect --disable_reconnect
SET SESSION debug_dbug="-d,ib_import_before_commit_crash";
#### Before commit crash #### Before commit crash
# Check that the DD is consistent after recovery # Check that the DD is consistent after recovery
...@@ -119,7 +105,7 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ...@@ -119,7 +105,7 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
# recreate the table and do a proper import. # recreate the table and do a proper import.
-- source include/wait_until_disconnected.inc -- source include/wait_until_disconnected.inc
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -129,7 +115,6 @@ EOF ...@@ -129,7 +115,6 @@ EOF
--source include/wait_until_connected_again.inc --source include/wait_until_connected_again.inc
--disable_reconnect --disable_reconnect
SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash";
#### Before checkpoint crash #### Before checkpoint crash
# After the above test the results are non-deterministic, recreate the table # After the above test the results are non-deterministic, recreate the table
...@@ -137,14 +122,12 @@ SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash"; ...@@ -137,14 +122,12 @@ SET SESSION debug_dbug="-d,ib_import_before_checkpoint_crash";
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;
SET GLOBAL innodb_file_format = `Barracuda`;
SELECT @@innodb_file_format;
SET SESSION innodb_strict_mode=1; SET SESSION innodb_strict_mode=1;
SELECT @@SESSION.innodb_strict_mode; SET @file_per_table = @@GLOBAL.innodb_file_per_table;
SET @file_format = @@GLOBAL.innodb_file_format;
SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_file_format=Barracuda;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED; ROW_FORMAT=COMPRESSED;
...@@ -152,7 +135,7 @@ ROW_FORMAT=COMPRESSED; ...@@ -152,7 +135,7 @@ ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -178,11 +161,12 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -178,11 +161,12 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
# Test failure after reset of space id and LSN in the tablespace # 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"; SET SESSION debug_dbug="+d,ib_import_internal_error";
--replace_regex /'.*t1.cfg'/'t1.cfg'/ --replace_regex /'.*t1.cfg'/'t1.cfg'/
...@@ -190,11 +174,11 @@ SET SESSION debug_dbug="+d,ib_import_internal_error"; ...@@ -190,11 +174,11 @@ SET SESSION debug_dbug="+d,ib_import_internal_error";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_internal_error"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -214,7 +198,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -214,7 +198,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -228,11 +212,11 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ...@@ -228,11 +212,11 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
SET SESSION debug_dbug="-d,ib_import_reset_space_and_lsn_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Test failure after attempting a tablespace open # Test failure after attempting a tablespace open
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
...@@ -241,11 +225,11 @@ SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ...@@ -241,11 +225,11 @@ SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_open_tablespace_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -256,11 +240,11 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; ...@@ -256,11 +240,11 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_check_bitmap_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -270,11 +254,11 @@ SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; ...@@ -270,11 +254,11 @@ SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_cluster_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -284,11 +268,11 @@ SET SESSION debug_dbug="+d,ib_import_cluster_failure"; ...@@ -284,11 +268,11 @@ SET SESSION debug_dbug="+d,ib_import_cluster_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_cluster_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -298,11 +282,11 @@ SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; ...@@ -298,11 +282,11 @@ SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_sec_root_adjust_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -312,11 +296,11 @@ SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; ...@@ -312,11 +296,11 @@ SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_set_max_rowid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
# Left over from the failed IMPORT # Left over from the failed IMPORT
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -342,10 +326,12 @@ CREATE TABLE test_wl5522.t1 ( ...@@ -342,10 +326,12 @@ CREATE TABLE test_wl5522.t1 (
INDEX idx1(c2), INDEX idx1(c2),
INDEX idx2(c3(512)), INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ROW_FORMAT=COMPRESSED;
# Stop purge so that it doesn't remove the delete marked entries. # Stop purge so that it doesn't remove the delete marked entries.
SET GLOBAL INNODB_PURGE_STOP_NOW=ON; connect (purge_control,localhost,root);
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
# Disable change buffer merge from the master thread, additionally # Disable change buffer merge from the master thread, additionally
# enable aggressive flushing so that more changes are buffered. # enable aggressive flushing so that more changes are buffered.
...@@ -398,7 +384,7 @@ SELECT name ...@@ -398,7 +384,7 @@ SELECT name
FLUSH TABLES test_wl5522.t1 FOR EXPORT; FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1"); ib_backup_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -415,7 +401,10 @@ SELECT name ...@@ -415,7 +401,10 @@ SELECT name
SET GLOBAL innodb_disable_background_merge=OFF; SET GLOBAL innodb_disable_background_merge=OFF;
# Enable normal operation # Enable normal operation
SET GLOBAL INNODB_PURGE_RUN_NOW=ON; connection purge_control;
COMMIT;
disconnect purge_control;
connection default;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
...@@ -427,14 +416,14 @@ CREATE TABLE test_wl5522.t1 ( ...@@ -427,14 +416,14 @@ CREATE TABLE test_wl5522.t1 (
INDEX idx1(c2), INDEX idx1(c2),
INDEX idx2(c3(512)), INDEX idx2(c3(512)),
INDEX idx3(c4(512))) Engine=InnoDB INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ROW_FORMAT=COMPRESSED;
SELECT c1, c2 FROM test_wl5522.t1; SELECT c1, c2 FROM test_wl5522.t1;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -455,7 +444,7 @@ DROP TABLE test_wl5522.t1; ...@@ -455,7 +444,7 @@ DROP TABLE test_wl5522.t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO test_wl5522.t1 VALUES INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200)); (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;
...@@ -470,7 +459,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -470,7 +459,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
FLUSH TABLES test_wl5522.t1 FOR EXPORT; FLUSH TABLES test_wl5522.t1 FOR EXPORT;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1"); ib_backup_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -488,7 +477,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -488,7 +477,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -499,12 +488,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; ...@@ -499,12 +488,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -520,24 +509,24 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -520,24 +509,24 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
SET SESSION debug_dbug="+d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/ --replace_regex /'.*t1.cfg'/'t1.cfg'/
# Following alter is not failing # Following alter is failing
#--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,buf_page_is_corrupt_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -551,7 +540,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -551,7 +540,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -562,12 +551,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; ...@@ -562,12 +551,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
--error ER_INNODB_INDEX_CORRUPT --error ER_INNODB_INDEX_CORRUPT
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_2"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -581,7 +570,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -581,7 +570,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -592,12 +581,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; ...@@ -592,12 +581,12 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
--error ER_NOT_KEYFILE --error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,ib_import_trigger_corruption_3"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -613,12 +602,12 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; ...@@ -613,12 +602,12 @@ SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
SET SESSION debug_dbug="-d,ib_import_create_index_failure_1"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -634,7 +623,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -634,7 +623,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -644,12 +633,12 @@ SET SESSION debug_dbug="+d,fil_space_create_failure"; ...@@ -644,12 +633,12 @@ SET SESSION debug_dbug="+d,fil_space_create_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,fil_space_create_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -665,7 +654,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -665,7 +654,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -675,12 +664,12 @@ SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ...@@ -675,12 +664,12 @@ SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,dict_tf_to_fsp_flags_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -696,7 +685,7 @@ SELECT COUNT(*) FROM test_wl5522.t1; ...@@ -696,7 +685,7 @@ SELECT COUNT(*) FROM test_wl5522.t1;
# Restore files # Restore files
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1"); ib_restore_tablespaces("test_wl5522", "t1");
EOF EOF
...@@ -707,12 +696,12 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; ...@@ -707,12 +696,12 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
--error ER_INTERNAL_ERROR --error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="-d,fsp_flags_is_valid_failure"; SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1; DROP TABLE test_wl5522.t1;
perl; perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1"); ib_unlink_tablespace("test_wl5522", "t1");
EOF EOF
...@@ -747,13 +736,12 @@ call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted"); ...@@ -747,13 +736,12 @@ 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("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("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 'test_wl5522.*t1'");
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
--enable_query_log --enable_query_log
#cleanup #cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd --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;
eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format; SET GLOBAL innodb_file_format = @file_format;
eval SET SESSION innodb_strict_mode=$innodb_strict_mode_orig;
...@@ -577,6 +577,8 @@ buf_page_is_corrupted( ...@@ -577,6 +577,8 @@ buf_page_is_corrupted(
ulint zip_size) /*!< in: size of compressed page; ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */ 0 for uncompressed pages */
{ {
DBUG_EXECUTE_IF("buf_page_import_corrupt_failure", return(TRUE); );
ulint checksum_field1; ulint checksum_field1;
ulint checksum_field2; ulint checksum_field2;
...@@ -658,8 +660,6 @@ buf_page_is_corrupted( ...@@ -658,8 +660,6 @@ buf_page_is_corrupted(
return(FALSE); return(FALSE);
} }
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
ulint page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET); ulint page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET);
ulint space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID); ulint space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID);
const srv_checksum_algorithm_t curr_algo = const srv_checksum_algorithm_t curr_algo =
...@@ -4216,7 +4216,7 @@ buf_page_io_complete( ...@@ -4216,7 +4216,7 @@ buf_page_io_complete(
/* Not a real corruption if it was triggered by /* Not a real corruption if it was triggered by
error injection */ error injection */
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", DBUG_EXECUTE_IF("buf_page_import_corrupt_failure",
if (bpage->space > TRX_SYS_SPACE if (bpage->space > TRX_SYS_SPACE
&& buf_mark_space_corrupt(bpage)) { && buf_mark_space_corrupt(bpage)) {
ib_logf(IB_LOG_LEVEL_INFO, ib_logf(IB_LOG_LEVEL_INFO,
...@@ -4279,7 +4279,7 @@ buf_page_io_complete( ...@@ -4279,7 +4279,7 @@ buf_page_io_complete(
} }
} }
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", DBUG_EXECUTE_IF("buf_page_import_corrupt_failure",
page_not_corrupt: bpage = bpage; ); page_not_corrupt: bpage = bpage; );
if (recv_recovery_is_on()) { if (recv_recovery_is_on()) {
......
...@@ -5099,7 +5099,20 @@ ibuf_check_bitmap_on_import( ...@@ -5099,7 +5099,20 @@ ibuf_check_bitmap_on_import(
return(DB_TABLE_NOT_FOUND); return(DB_TABLE_NOT_FOUND);
} }
size = fil_space_get_size(space_id); mtr_t mtr;
mtr_start(&mtr);
{
buf_block_t* sp = buf_page_get(space_id, zip_size, 0,
RW_S_LATCH, &mtr);
if (sp) {
size = mach_read_from_4(
FSP_HEADER_OFFSET + FSP_FREE_LIMIT
+ sp->frame);
} else {
size = 0;
}
}
mtr_commit(&mtr);
if (size == 0) { if (size == 0) {
return(DB_TABLE_NOT_FOUND); return(DB_TABLE_NOT_FOUND);
...@@ -5110,7 +5123,6 @@ ibuf_check_bitmap_on_import( ...@@ -5110,7 +5123,6 @@ ibuf_check_bitmap_on_import(
page_size = zip_size ? zip_size : UNIV_PAGE_SIZE; page_size = zip_size ? zip_size : UNIV_PAGE_SIZE;
for (page_no = 0; page_no < size; page_no += page_size) { for (page_no = 0; page_no < size; page_no += page_size) {
mtr_t mtr;
page_t* bitmap_page; page_t* bitmap_page;
ulint i; ulint i;
......
...@@ -646,6 +646,8 @@ buf_page_is_corrupted( ...@@ -646,6 +646,8 @@ buf_page_is_corrupted(
ulint zip_size) /*!< in: size of compressed page; ulint zip_size) /*!< in: size of compressed page;
0 for uncompressed pages */ 0 for uncompressed pages */
{ {
DBUG_EXECUTE_IF("buf_page_import_corrupt_failure", return(TRUE); );
ulint checksum_field1; ulint checksum_field1;
ulint checksum_field2; ulint checksum_field2;
...@@ -727,8 +729,6 @@ buf_page_is_corrupted( ...@@ -727,8 +729,6 @@ buf_page_is_corrupted(
return(FALSE); return(FALSE);
} }
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", return(TRUE); );
ulint page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET); ulint page_no = mach_read_from_4(read_buf + FIL_PAGE_OFFSET);
ulint space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID); ulint space_id = mach_read_from_4(read_buf + FIL_PAGE_SPACE_ID);
const srv_checksum_algorithm_t curr_algo = const srv_checksum_algorithm_t curr_algo =
...@@ -4421,7 +4421,7 @@ buf_page_io_complete( ...@@ -4421,7 +4421,7 @@ buf_page_io_complete(
/* Not a real corruption if it was triggered by /* Not a real corruption if it was triggered by
error injection */ error injection */
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", DBUG_EXECUTE_IF("buf_page_import_corrupt_failure",
if (bpage->space > TRX_SYS_SPACE if (bpage->space > TRX_SYS_SPACE
&& buf_mark_space_corrupt(bpage)) { && buf_mark_space_corrupt(bpage)) {
ib_logf(IB_LOG_LEVEL_INFO, ib_logf(IB_LOG_LEVEL_INFO,
...@@ -4502,7 +4502,7 @@ buf_page_io_complete( ...@@ -4502,7 +4502,7 @@ buf_page_io_complete(
} }
} /**/ } /**/
DBUG_EXECUTE_IF("buf_page_is_corrupt_failure", DBUG_EXECUTE_IF("buf_page_import_corrupt_failure",
page_not_corrupt: bpage = bpage; ); page_not_corrupt: bpage = bpage; );
if (recv_recovery_is_on()) { if (recv_recovery_is_on()) {
......
...@@ -5141,7 +5141,20 @@ ibuf_check_bitmap_on_import( ...@@ -5141,7 +5141,20 @@ ibuf_check_bitmap_on_import(
return(DB_TABLE_NOT_FOUND); return(DB_TABLE_NOT_FOUND);
} }
size = fil_space_get_size(space_id); mtr_t mtr;
mtr_start(&mtr);
{
buf_block_t* sp = buf_page_get(space_id, zip_size, 0,
RW_S_LATCH, &mtr);
if (sp) {
size = mach_read_from_4(
FSP_HEADER_OFFSET + FSP_FREE_LIMIT
+ sp->frame);
} else {
size = 0;
}
}
mtr_commit(&mtr);
if (size == 0) { if (size == 0) {
return(DB_TABLE_NOT_FOUND); return(DB_TABLE_NOT_FOUND);
...@@ -5152,7 +5165,6 @@ ibuf_check_bitmap_on_import( ...@@ -5152,7 +5165,6 @@ ibuf_check_bitmap_on_import(
page_size = zip_size ? zip_size : UNIV_PAGE_SIZE; page_size = zip_size ? zip_size : UNIV_PAGE_SIZE;
for (page_no = 0; page_no < size; page_no += page_size) { for (page_no = 0; page_no < size; page_no += page_size) {
mtr_t mtr;
page_t* bitmap_page; page_t* bitmap_page;
ulint i; ulint i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment