[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.117.183.206: ~ $
# Not supported in embedded
--source include/not_embedded.inc

# Adding big test option for this test.
--source include/big_test.inc

# This test case needs to crash the server. Needs a debug server.
--source include/have_debug.inc

# Don't test this under valgrind, memory leaks will occur.
--source include/not_valgrind.inc

# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc

-- source include/have_innodb.inc

let MYSQLD_DATADIR =`SELECT @@datadir`;
let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/;
let $strerrfix=/ (\(.+\))//;

SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;

DROP DATABASE IF EXISTS test_wl5522;
CREATE DATABASE test_wl5522;

##### Before DISCARD commit crash
SET SESSION debug="+d,ib_discard_before_commit_crash";

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);

# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect

SET SESSION debug="-d,ib_discard_before_commit_crash";
DROP TABLE test_wl5522.t1;
#### Before DISCARD commit crash

##### After DISCARD commit crash
SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;

SET SESSION debug="+d,ib_discard_after_commit_crash";

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB;
INSERT INTO test_wl5522.t1 VALUES(1),(2),(3);

# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect

SET SESSION debug="-d,ib_discard_after_commit_crash";
DROP TABLE test_wl5522.t1;
#### After DISCARD commit crash

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 TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

perl;
do 'include/innodb-util.inc';
ib_backup_tablespaces("test_wl5522", "t1");
EOF
UNLOCK TABLES;

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

##### Before commit crash
SET SESSION debug="+d,ib_import_before_commit_crash";

--error ER_TABLESPACE_DISCARDED
SELECT * FROM test_wl5522.t1;

# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

--enable_reconnect
--source include/wait_until_connected_again.inc
--disable_reconnect

SET SESSION debug="-d,ib_import_before_commit_crash";
#### Before commit crash

# Check that the DD is consistent after recovery

##### Before checkpoint crash
SET SESSION debug="+d,ib_import_before_checkpoint_crash";

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Don't start up the server right away.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect

# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

# After the above test the results are non-deterministic,
# delete the old tablespace files and drop the table,
# recreate the table and do a proper import.
-- source include/wait_until_disconnected.inc
perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

--echo # Restart and reconnect to the server
--enable_reconnect
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--source include/wait_until_connected_again.inc
--disable_reconnect

SET SESSION debug="-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;

SET GLOBAL innodb_file_per_table = 1;
SELECT @@innodb_file_per_table;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;

SELECT COUNT(*) FROM test_wl5522.t1;

INSERT INTO test_wl5522.t1 VALUES(400), (500), (600);

SELECT * FROM test_wl5522.t1;

DROP TABLE test_wl5522.t1;

# Test IO Write error(s), flush tables doesn't return an error message
# so we have to make do with the error/warning pushed by the server
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_1";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_1";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_2";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_2";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_3";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_3";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_4";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_4";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_5";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_5";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_6";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_6";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_7";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_7";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_8";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_8";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_9";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_9";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_10";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_10";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_11";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_11";

DROP TABLE test_wl5522.t1;


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

SET SESSION debug="+d,ib_export_io_write_failure_12";

--replace_regex /, .*).*t1.cfg/, Bad file descriptor) t1.cfg/

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

UNLOCK TABLES;

SET SESSION debug="-d,ib_export_io_write_failure_12";

DROP TABLE test_wl5522.t1;

# Create a table and save the tablespace and .cfg file
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (100), (200), (300);
SELECT COUNT(*) FROM test_wl5522.t1;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;

perl;
do 'include/innodb-util.inc';
ib_backup_tablespaces("test_wl5522", "t1");
EOF

UNLOCK TABLES;

DROP TABLE test_wl5522.t1;

# Test IO Read error(s)
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_1";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_1";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_2";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_2";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_3";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_3";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_4";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_4";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_5";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_5";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_6";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_6";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_7";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_7";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_8";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_8";

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_io_read_error_9";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_io_read_error_9";

DROP TABLE test_wl5522.t1;

# Test string read failure
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_string_read_error";

perl;
do 'include/innodb-util.inc';
ib_restore_cfg_files("test_wl5522", "t1");
EOF

--replace_regex $strerrfix

--error ER_IO_READ_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_string_read_error";

DROP TABLE test_wl5522.t1;

# Test OOM error during import

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_1";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_1";

DROP TABLE test_wl5522.t1;


perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_2";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_2";

DROP TABLE test_wl5522.t1;


perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_4";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_4";

DROP TABLE test_wl5522.t1;


perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF


CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_5";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_5";

DROP TABLE test_wl5522.t1;


perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_6";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_6";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_7";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_7";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_8";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_8";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_9";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_9";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;
INSERT INTO test_wl5522.t1 VALUES (1);

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_OOM_10";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_OUT_OF_RESOURCES 
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_OOM_10";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

####
# Test handling of internal failure error
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after reset of space id and LSN in the tablespace
SET SESSION debug="+d,ib_import_internal_error";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_internal_error";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

DROP TABLE test_wl5522.t1;


# Test failure after reset of space id and LSN in the tablespace
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after reset of space id and LSN in the tablespace
SET SESSION debug="+d,ib_import_reset_space_and_lsn_failure";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="-d,ib_import_reset_space_and_lsn_failure";

# Test failure after attempting a tablespace open
SET SESSION debug="+d,ib_import_open_tablespace_failure";

--replace_regex /file: '.*t1.ibd'/'t1.ibd'/

--error ER_FILE_NOT_FOUND
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_open_tablespace_failure";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after ibuf check
SET SESSION debug="+d,ib_import_check_bitmap_failure";

# Need proper mapping of error codes :-(
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_check_bitmap_failure";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after adjusting the cluster index root page
SET SESSION debug="+d,ib_import_cluster_root_adjust_failure";

--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_cluster_root_adjust_failure";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after importing the cluster index
SET SESSION debug="+d,ib_import_cluster_failure";

--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_cluster_failure";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after importing the secondary index(es)
SET SESSION debug="+d,ib_import_sec_root_adjust_failure";

--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_sec_root_adjust_failure";

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

# Test failure after importing the cluster index
SET SESSION debug="+d,ib_import_set_max_rowid_failure";

--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_set_max_rowid_failure";

# Left over from the failed IMPORT
perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

DROP TABLE test_wl5522.t1;

--disable_query_log
# Enable metrics for the counters we are going to use
set global innodb_monitor_enable = purge_stop_count;
set global innodb_monitor_enable = purge_resume_count;
set global innodb_monitor_enable = ibuf_merges;
set global innodb_monitor_enable = ibuf_merges_insert;
--enable_query_log

#
# Create a large table with delete marked records, disable purge during
# the update so that we can test the IMPORT purge code.
#
CREATE TABLE test_wl5522.t1 (
	c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	c2 BIGINT,
	c3 VARCHAR(2048),
	c4 VARCHAR(2048),
	INDEX idx1(c2),
	INDEX idx2(c3(512)),
	INDEX idx3(c4(512))) Engine=InnoDB;

# Stop purge so that it doesn't remove the delete marked entries.
SET GLOBAL INNODB_PURGE_STOP_NOW=ON;

# Disable change buffer merge from the master thread, additionally
# enable aggressive flushing so that more changes are buffered.
SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;

INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES
	(1, REPEAT('a', 2048), REPEAT('a', 2048)),
	(2, REPEAT('b', 2048), REPEAT('b', 2048)),
	(3, REPEAT('c', 2048), REPEAT('c', 2048)),
	(4, REPEAT('d', 2048), REPEAT('d', 2048));

INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;

DELETE FROM test_wl5522.t1 WHERE c2 = 1;

UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024);
UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024);

SHOW CREATE TABLE test_wl5522.t1;

SELECT c1, c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;

SELECT name
  FROM information_schema.innodb_metrics
  WHERE name = 'ibuf_merges_insert' AND count = 0;

FLUSH TABLES test_wl5522.t1 FOR EXPORT;

perl;
do 'include/innodb-util.inc';
ib_backup_tablespaces("test_wl5522", "t1");
EOF

UNLOCK TABLES;

SELECT name
  FROM information_schema.innodb_metrics
  WHERE name = 'ibuf_merges' AND count > 0;

SELECT name
  FROM information_schema.innodb_metrics
  WHERE name = 'ibuf_merges_inserts' AND count > 0;

SET GLOBAL innodb_disable_background_merge=OFF;

# Enable normal operation
SET GLOBAL INNODB_PURGE_RUN_NOW=ON;

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (
	c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
	c2 BIGINT,
	c3 VARCHAR(2048),
	c4 VARCHAR(2048),
	INDEX idx1(c2),
	INDEX idx2(c3(512)),
	INDEX idx3(c4(512))) Engine=InnoDB;

SELECT c1, c2 FROM test_wl5522.t1;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;

SELECT c1,c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;

SHOW CREATE TABLE test_wl5522.t1;

DROP TABLE test_wl5522.t1;

####
# Create a table and save the tablespace and .cfg file, we need to create
# a Btree that has several levels
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

INSERT INTO test_wl5522.t1 VALUES
	(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200));

INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;

perl;
do 'include/innodb-util.inc';
ib_backup_tablespaces("test_wl5522", "t1");
EOF

UNLOCK TABLES;

DROP TABLE test_wl5522.t1;

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_trigger_corruption_1";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_trigger_corruption_1";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

#

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,buf_page_is_corrupt_failure";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,buf_page_is_corrupt_failure";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_trigger_corruption_2";

--replace_regex $pathfix

--error ER_INNODB_INDEX_CORRUPT
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_trigger_corruption_2";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF
#

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,ib_import_trigger_corruption_3";

--replace_regex $pathfix

--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,ib_import_trigger_corruption_3";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

SET SESSION debug="+d,ib_import_create_index_failure_1";

ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);

SET SESSION debug="-d,ib_import_create_index_failure_1";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

#

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,fil_space_create_failure";

--replace_regex $pathfix

--error ER_FILE_NOT_FOUND
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,fil_space_create_failure";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

#

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,dict_tf_to_fsp_flags_failure";

--replace_regex $pathfix

--error ER_FILE_NOT_FOUND
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,dict_tf_to_fsp_flags_failure";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF

#

CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb;

ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;

--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;

# Restore files
perl;
do 'include/innodb-util.inc';
ib_restore_tablespaces("test_wl5522", "t1");
EOF

SET SESSION debug="+d,fsp_flags_is_valid_failure";

--replace_regex /'.*t1.cfg'/'t1.cfg'/

--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;

SET SESSION debug="-d,fsp_flags_is_valid_failure";

DROP TABLE test_wl5522.t1;

perl;
do 'include/innodb-util.inc';
ib_unlink_tablespace("test_wl5522", "t1");
EOF


DROP DATABASE test_wl5522;

set global innodb_monitor_disable = all;
set global innodb_monitor_reset_all = all;

-- disable_warnings
set global innodb_monitor_enable = default;
set global innodb_monitor_disable = default;
set global innodb_monitor_reset = default;
set global innodb_monitor_reset_all = default;
-- enable_warnings

--disable_query_log
call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles!");
call mtr.add_suppression("'Resource temporarily unavailable'");
call mtr.add_suppression("Monitor ibuf_merges is already enabled");
call mtr.add_suppression("Monitor ibuf_merges_insert is already enabled");
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded.");
call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache.*");
call mtr.add_suppression("InnoDB: Freeing existing tablespace '.*' entry from the cache with id.*");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
call mtr.add_suppression(".*There was an error writing to the meta data file.*");
call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file");
call mtr.add_suppression("Unsupported tablespace format");
call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\"");
call mtr.add_suppression("Page is marked as free");
call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted");
call mtr.add_suppression("but tablespace with that id or name does not exist");
call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache");
call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'");
call mtr.add_suppression("while reading index meta-data, expected to read 44 bytes but read only 0 bytes");
--enable_query_log

#cleanup
--remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg
--remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd

eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;


Filemanager

Name Type Size Permission Actions
add_foreign_key.test File 1.35 KB 0644
alter_rename_existing.test File 3.02 KB 0644
analyze_table.test File 803 B 0644
autoinc_debug.test File 2.14 KB 0644
blob-update-debug.test File 525 B 0644
blob_redo-master.opt File 57 B 0644
blob_redo.test File 2.35 KB 0644
bulk_create_index_online.test File 1.15 KB 0644
checksum.test File 644 B 0644
create-index.test File 1.29 KB 0644
create_isl_with_direct-master.opt File 31 B 0644
create_isl_with_direct.test File 1010 B 0644
disabled.def File 404 B 0644
dropdb.test File 251 B 0644
end_range_check.test File 1.82 KB 0644
events-merge-tmp-path-master.opt File 149 B 0644
events-merge-tmp-path.test File 1.65 KB 0644
flush-hang.test File 1.51 KB 0644
foreign_key.test File 2.18 KB 0644
ibuf_not_empty-master.opt File 30 B 0644
ibuf_not_empty.test File 3.2 KB 0644
import.test File 763 B 0644
import_tablespace_schema_missmatch.test File 3.6 KB 0644
import_update_stats.test File 1.46 KB 0644
index_length.test File 1.31 KB 0644
index_tree_operation.test File 2.36 KB 0644
innodb-2byte-collation-master.opt File 48 B 0644
innodb-2byte-collation.test File 2.95 KB 0644
innodb-ac-non-locking-select.test File 3 KB 0644
innodb-alter-autoinc.test File 2.63 KB 0644
innodb-alter-debug.test File 2.69 KB 0644
innodb-alter-discard.test File 1.74 KB 0644
innodb-alter-nullable.test File 1.98 KB 0644
innodb-alter-tempfile.test File 2.46 KB 0644
innodb-alter.test File 15.98 KB 0644
innodb-analyze.test File 1.65 KB 0644
innodb-autoinc-18274.test File 661 B 0644
innodb-autoinc-44030-master.opt File 81 B 0644
innodb-autoinc-44030.test File 1.61 KB 0644
innodb-autoinc-56228-master.opt File 29 B 0644
innodb-autoinc-56228.test File 784 B 0644
innodb-autoinc-master.opt File 81 B 0644
innodb-autoinc-optimize.test File 482 B 0644
innodb-autoinc.test File 25.87 KB 0644
innodb-blob.test File 6.14 KB 0644
innodb-bug-14068765.test File 3.41 KB 0644
innodb-bug-14084530.test File 1.31 KB 0644
innodb-bug12552164.test File 1.43 KB 0644
innodb-bug14219515.test File 472 B 0644
innodb-change-buffer-recovery-master.opt File 62 B 0644
innodb-change-buffer-recovery.test File 2.27 KB 0644
innodb-consistent-master.opt File 29 B 0644
innodb-consistent.test File 1.24 KB 0644
innodb-double-write.test File 11.92 KB 0644
innodb-index-debug-master.opt File 30 B 0644
innodb-index-debug.test File 3.14 KB 0644
innodb-index-online-delete.test File 1.06 KB 0644
innodb-index-online-fk.test File 14.48 KB 0644
innodb-index-online-master.opt File 128 B 0644
innodb-index-online-norebuild.test File 1.8 KB 0644
innodb-index-online-purge.test File 2.07 KB 0644
innodb-index-online.test File 13.08 KB 0644
innodb-index.test File 16.93 KB 0644
innodb-index_ucs2.test File 124 B 0644
innodb-lock-inherit-read_commited.test File 2.58 KB 0644
innodb-lock.test File 4.27 KB 0644
innodb-log-file-size-1.test File 10.53 KB 0644
innodb-log-file-size.test File 7.33 KB 0644
innodb-master.opt File 136 B 0644
innodb-multiple-tablespaces.test File 18.88 KB 0644
innodb-read-view.test File 3.63 KB 0644
innodb-replace.test File 555 B 0644
innodb-semi-consistent-master.opt File 29 B 0644
innodb-semi-consistent.test File 1.83 KB 0644
innodb-status-output.test File 3.23 KB 0644
innodb-system-table-view.test File 6.46 KB 0644
innodb-table-online-master.opt File 128 B 0644
innodb-table-online.test File 11.35 KB 0644
innodb-tablespace.test File 16.16 KB 0644
innodb-timeout.test File 3.63 KB 0644
innodb-truncate.test File 2.03 KB 0644
innodb-ucs2.test File 11.41 KB 0644
innodb-update-insert.test File 860 B 0644
innodb-use-sys-malloc-master.opt File 56 B 0644
innodb-use-sys-malloc.test File 1.52 KB 0644
innodb-wl5522-1.test File 27.19 KB 0644
innodb-wl5522-debug.test File 35.31 KB 0644
innodb-wl5522.test File 19.19 KB 0644
innodb-wl5980-alter.test File 18.11 KB 0644
innodb-wl5980-debug.test File 2.58 KB 0644
innodb-wl5980-discard.test File 25.47 KB 0644
innodb-wl5980-linux.test File 7.54 KB 0644
innodb-wl5980-windows.test File 8.83 KB 0644
innodb-wl6445-1.test File 24.83 KB 0644
innodb-wl6445-2.test File 9.04 KB 0644
innodb-wl6445.test File 2.3 KB 0644
innodb.test File 79.03 KB 0644
innodb_autoinc_lock_mode_zero-master.opt File 29 B 0644
innodb_autoinc_lock_mode_zero.test File 1.1 KB 0644
innodb_autoinc_reset.test File 519 B 0644
innodb_blob_unrecoverable_crash.test File 1.56 KB 0644
innodb_buffer_pool_load-master.opt File 30 B 0644
innodb_buffer_pool_load.test File 3.94 KB 0644
innodb_bug-13628249.test File 3.95 KB 0644
innodb_bug11754376.test File 406 B 0644
innodb_bug11766634-master.opt File 16 B 0644
innodb_bug11766634.test File 1.82 KB 0644
innodb_bug11789106.test File 536 B 0644
innodb_bug11933790.test File 969 B 0644
innodb_bug12400341-master.opt File 75 B 0644
innodb_bug12400341.test File 2.57 KB 0644
innodb_bug12429573.test File 1.4 KB 0644
innodb_bug12661768.test File 1.99 KB 0644
innodb_bug13635833.test File 1.6 KB 0644
innodb_bug13867871.test File 5.7 KB 0644
innodb_bug14006907.test File 1.38 KB 0644
innodb_bug14007109.test File 1.19 KB 0644
innodb_bug14007649.test File 1.1 KB 0644
innodb_bug14147491-master.opt File 62 B 0644
innodb_bug14147491.test File 3.28 KB 0644
innodb_bug14169459.test File 1.96 KB 0644
innodb_bug14676111.test File 3.84 KB 0644
innodb_bug14704286.test File 2.03 KB 0644
innodb_bug21704.test File 1.66 KB 0644
innodb_bug30423.test File 6.51 KB 0644
innodb_bug30919-master.opt File 38 B 0644
innodb_bug30919.test File 2.27 KB 0644
innodb_bug34053.test File 1.41 KB 0644
innodb_bug34300.test File 852 B 0644
innodb_bug35220.test File 416 B 0644
innodb_bug38231.test File 1.64 KB 0644
innodb_bug39438-master.opt File 26 B 0644
innodb_bug39438.test File 2.19 KB 0644
innodb_bug40360.test File 340 B 0644
innodb_bug40565.test File 327 B 0644
innodb_bug41904.test File 328 B 0644
innodb_bug42101-nonzero-master.opt File 30 B 0644
innodb_bug42101-nonzero.test File 653 B 0644
innodb_bug42101.test File 577 B 0644
innodb_bug42419.test File 2.19 KB 0644
innodb_bug44032.test File 543 B 0644
innodb_bug44369.test File 530 B 0644
innodb_bug44571.test File 788 B 0644
innodb_bug45357.test File 326 B 0644
innodb_bug46000.test File 941 B 0644
innodb_bug46676.test File 602 B 0644
innodb_bug47167-master.opt File 16 B 0644
innodb_bug47167.test File 1.41 KB 0644
innodb_bug47621.test File 1.79 KB 0644
innodb_bug47622.test File 1.58 KB 0644
innodb_bug47777.test File 915 B 0644
innodb_bug48024.test File 863 B 0644
innodb_bug49164.test File 928 B 0644
innodb_bug51378.test File 2.53 KB 0644
innodb_bug51920.test File 988 B 0644
innodb_bug52199.test File 210 B 0644
innodb_bug52663.test File 1003 B 0644
innodb_bug53046.test File 1.27 KB 0644
innodb_bug53290.test File 909 B 0644
innodb_bug53592.test File 2.47 KB 0644
innodb_bug53674-master.opt File 65 B 0644
innodb_bug53674.test File 259 B 0644
innodb_bug53756-master.opt File 36 B 0644
innodb_bug53756.test File 4.62 KB 0644
innodb_bug54044.test File 606 B 0644
innodb_bug56143.test File 74.16 KB 0644
innodb_bug56716.test File 268 B 0644
innodb_bug56947.test File 472 B 0644
innodb_bug57252.test File 1.27 KB 0644
innodb_bug57255.test File 889 B 0644
innodb_bug57904.test File 908 B 0644
innodb_bug59307.test File 626 B 0644
innodb_bug59410.test File 805 B 0644
innodb_bug59641.test File 1.7 KB 0644
innodb_bug59733.test File 1.98 KB 0644
innodb_bug60049-master.opt File 25 B 0644
innodb_bug60049.test File 1.95 KB 0644
innodb_bug60196-master.opt File 27 B 0644
innodb_bug60196.test File 4.44 KB 0644
innodb_bug60229.test File 1.34 KB 0644
innodb_bug70867.test File 1.64 KB 0644
innodb_copy_col_in_partition.test File 665 B 0644
innodb_corrupt_bit.test File 4.21 KB 0644
innodb_ctype_ldml-master.opt File 80 B 0644
innodb_ctype_ldml.test File 15.32 KB 0644
innodb_deadlock_with_autoinc-master.opt File 29 B 0644
innodb_deadlock_with_autoinc.test File 1.22 KB 0644
innodb_file_format-master.opt File 16 B 0644
innodb_file_format.test File 1.32 KB 0644
innodb_file_limit_check-master.opt File 69 B 0644
innodb_file_limit_check.test File 1.07 KB 0644
innodb_force_recovery.test File 5.7 KB 0644
innodb_gis.test File 277 B 0644
innodb_i_s_innodb_locks.test File 4.54 KB 0644
innodb_i_s_innodb_trx.test File 2.32 KB 0644
innodb_information_schema_buffer.test File 2.39 KB 0644
innodb_io_pf.test File 398 B 0644
innodb_lock_wait_timeout_1-master.opt File 29 B 0644
innodb_lock_wait_timeout_1.test File 8.06 KB 0644
innodb_misc1-master.opt File 55 B 0644
innodb_misc1.test File 31.49 KB 0644
innodb_multi_update.test File 1.4 KB 0644
innodb_mysql-master.opt File 82 B 0644
innodb_mysql.test File 26.75 KB 0644
innodb_mysql_rbk-master.opt File 60 B 0644
innodb_mysql_rbk.test File 849 B 0644
innodb_notembedded.test File 1.13 KB 0644
innodb_page_size_func.test File 12.92 KB 0644
innodb_prefix_index_restart_server.test File 4.4 KB 0644
innodb_replace.test File 5.06 KB 0644
innodb_stats.test File 1.89 KB 0644
innodb_stats_auto_recalc.test File 1.76 KB 0644
innodb_stats_auto_recalc_ddl.test File 1.65 KB 0644
innodb_stats_auto_recalc_lots.test File 887 B 0644
innodb_stats_auto_recalc_on_nonexistent.test File 1.87 KB 0644
innodb_stats_create_on_corrupted.test File 1.27 KB 0644
innodb_stats_create_table.test File 1.43 KB 0644
innodb_stats_del_mark-master.opt File 40 B 0644
innodb_stats_del_mark.test File 3.6 KB 0644
innodb_stats_drop_locked.test File 1.41 KB 0644
innodb_stats_external_pages.test File 2.58 KB 0644
innodb_stats_fetch.test File 2.13 KB 0644
innodb_stats_fetch_corrupted.test File 1.6 KB 0644
innodb_stats_fetch_nonexistent.test File 1.14 KB 0644
innodb_stats_flag_global_off-master.opt File 28 B 0644
innodb_stats_flag_global_off.test File 324 B 0644
innodb_stats_flag_global_on-master.opt File 28 B 0644
innodb_stats_flag_global_on.test File 323 B 0644
innodb_stats_rename_table.test File 1.25 KB 0644
innodb_stats_rename_table_if_exists.test File 1.43 KB 0644
innodb_stats_sample_pages.test File 1.72 KB 0644
innodb_stats_table_flag_auto_recalc.test File 2.19 KB 0644
innodb_stats_table_flag_sample_pages.test File 2.73 KB 0644
innodb_sys_var_valgrind.test File 1.99 KB 0644
innodb_timeout_rollback-master.opt File 58 B 0644
innodb_timeout_rollback.test File 108 B 0644
innodb_trx_weight.test File 3.65 KB 0644
innodb_upd_stats_if_needed_not_inited.test File 1.04 KB 0644
innodb_ut_format_name.test File 298 B 0644
insert_debug.test File 476 B 0644
monitor.test File 13.96 KB 0644
monitor_debug.test File 1.07 KB 0644
portability_wl5980_linux.zip File 473.02 KB 0644
portability_wl5980_windows.zip File 514.24 KB 0644
sp_temp_table.test File 2.51 KB 0644
strict_checksum.test File 2.77 KB 0644
strict_mode.test File 3.22 KB 0644
timestamp.test File 787 B 0644
tmpdir.test File 1.9 KB 0644
undo_space_id.test File 889 B 0644
xa_recovery.test File 1.13 KB 0644