diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-20 18:08:16 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-03-20 18:12:17 +0200 |
commit | 44298e4dea39280187c587c6e776ce8d04e350de (patch) | |
tree | 15f8bac3c985c4f07fd6af066439d046dbb13c35 /mysql-test/suite/innodb/t | |
parent | dd68db0c17d674f1b64e70ff7ea9e3f4abe4ee3e (diff) | |
parent | 9f7b8625e698da6b7eba7c26e765c66635571919 (diff) | |
download | mariadb-git-44298e4dea39280187c587c6e776ce8d04e350de.tar.gz |
Merge 10.2 into 10.3
Also, clean up the test innodb_gis.geometry a little further.
Diffstat (limited to 'mysql-test/suite/innodb/t')
10 files changed, 871 insertions, 503 deletions
diff --git a/mysql-test/suite/innodb/t/alter_missing_tablespace.test b/mysql-test/suite/innodb/t/alter_missing_tablespace.test index 287aa437d10..c1cfc0fa092 100644 --- a/mysql-test/suite/innodb/t/alter_missing_tablespace.test +++ b/mysql-test/suite/innodb/t/alter_missing_tablespace.test @@ -59,7 +59,9 @@ ALTER TABLE t ALGORITHM=COPY, DISCARD TABLESPACE; --error ER_PARSE_ERROR ALTER TABLE t ALGORITHM=DEFAULT, DISCARD TABLESPACE; ALTER TABLE t DISCARD TABLESPACE; -DROP TABLE t; +RENAME TABLE t TO u; +RENAME TABLE u TO v; +DROP TABLE v; --error ER_GET_ERRNO SELECT * FROM `x..d`; DROP TABLE `x..d`; diff --git a/mysql-test/suite/innodb/t/buf_pool_resize_oom.opt b/mysql-test/suite/innodb/t/buf_pool_resize_oom.opt new file mode 100644 index 00000000000..09fd8bd8e35 --- /dev/null +++ b/mysql-test/suite/innodb/t/buf_pool_resize_oom.opt @@ -0,0 +1 @@ +--innodb-buffer-pool-size=8m --innodb-buffer-pool-chunk-size=1m diff --git a/mysql-test/suite/innodb/t/buf_pool_resize_oom.test b/mysql-test/suite/innodb/t/buf_pool_resize_oom.test new file mode 100644 index 00000000000..b0aa20b566f --- /dev/null +++ b/mysql-test/suite/innodb/t/buf_pool_resize_oom.test @@ -0,0 +1,28 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +--source include/not_embedded.inc + +--echo # +--echo # Bug #21348684 SIGABRT DURING RESIZING THE INNODB BUFFER POOL +--echo # ONLINE WITH MEMORY FULL CONDITION +--echo # + +call mtr.add_suppression("InnoDB: .* failed to allocate the chunk array"); + +SET GLOBAL innodb_disable_resize_buffer_pool_debug=OFF; +SET GLOBAL debug_dbug='+d,buf_pool_resize_chunk_null'; + +--disable_warnings +SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size + 1048576; +--enable_warnings + +let $wait_timeout = 60; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 27) = 'Resizing buffer pool failed' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; + +--source include/wait_condition.inc +# Restart the server, because the buffer pool would not necessarily be +# shrunk afterwards even if we request it. +--source include/restart_mysqld.inc diff --git a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test index b443c92aff9..b2809aa0669 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522-debug.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522-debug.test @@ -15,6 +15,7 @@ --source include/have_innodb.inc --source include/default_charset.inc +--source include/have_sequence.inc call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation."); call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified."); @@ -29,16 +30,11 @@ call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS="); FLUSH TABLES; let MYSQLD_DATADIR =`SELECT @@datadir`; -let $innodb_file_per_table = `SELECT @@innodb_file_per_table`; -let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522\\t1.ibd'/; let $strerrfix=/ (\(.+\))//; - SET GLOBAL innodb_file_per_table = 1; -CREATE DATABASE test_wl5522; - -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); --let $_server_id= `SELECT @@server_id` --let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect @@ -46,574 +42,574 @@ INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_before_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = InnoDB; -INSERT INTO test_wl5522.t1 VALUES(1),(2),(3); +CREATE TABLE t1 (c1 INT) ENGINE = InnoDB; +INSERT INTO t1 VALUES(1),(2),(3); --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_discard_after_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; SET GLOBAL innodb_file_per_table = 1; # Create the table that we will use for crash recovery (during IMPORT) -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1), (2), (3), (4); --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF --error ER_TABLESPACE_DISCARDED -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; --source include/start_mysqld.inc # Check that the DD is consistent after recovery --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; --exec echo wait > $_expect_file_name SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; --error 2013 -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # After the above test the results are non-deterministic, # delete the old tablespace files and drop the table, # recreate the table and do a proper import. perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF --source include/start_mysqld.inc -DROP TABLE test_wl5522.t1; +DROP TABLE t1; +SET @file_per_table= @@innodb_file_per_table; SET GLOBAL innodb_file_per_table = 1; -SELECT @@innodb_file_per_table; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; -INSERT INTO test_wl5522.t1 VALUES(400), (500), (600); +INSERT INTO t1 VALUES(400), (500), (600); -SELECT * FROM test_wl5522.t1; +SELECT * FROM t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test IO Write error(s), flush tables doesn't return an error message # so we have to make do with the error/warning pushed by the server -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET @saved_debug_dbug = @@SESSION.debug_dbug; SET SESSION debug_dbug="+d,ib_export_io_write_failure_1"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_2"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_3"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_4"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_5"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_6"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_7"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_8"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_9"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_10"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_11"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); SET SESSION debug_dbug="+d,ib_export_io_write_failure_12"; --replace_regex /, .*\).*t1.cfg/, Bad file descriptor) t1.cfg/ -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; UNLOCK TABLES; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Create a table and save the tablespace and .cfg file -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (100), (200), (300); -SELECT COUNT(*) FROM test_wl5522.t1; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (100), (200), (300); +SELECT COUNT(*) FROM t1; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test IO Read error(s) -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_1"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_2"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_3"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_4"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_5"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_6"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_7"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_8"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_io_read_error_9"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test string read failure -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_string_read_error"; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_cfg_files("test_wl5522", "t1"); +ib_restore_cfg_files("test", "t1"); EOF --replace_regex $strerrfix --error ER_IO_READ_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test OOM error during import -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_1"; @@ -621,31 +617,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_1"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_2"; @@ -653,31 +649,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_2"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_4"; @@ -685,31 +681,31 @@ SET SESSION debug_dbug="+d,ib_import_OOM_4"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_5"; @@ -717,30 +713,30 @@ SET SESSION debug_dbug="+d,ib_import_OOM_5"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_6"; @@ -748,29 +744,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_6"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_7"; @@ -778,29 +774,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_7"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_8"; @@ -808,29 +804,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_8"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_9"; @@ -838,29 +834,29 @@ SET SESSION debug_dbug="+d,ib_import_OOM_9"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; -INSERT INTO test_wl5522.t1 VALUES (1); +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; +INSERT INTO t1 VALUES (1); -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_OOM_10"; @@ -868,30 +864,30 @@ SET SESSION debug_dbug="+d,ib_import_OOM_10"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_OUT_OF_RESOURCES -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF #### # Test handling of internal failure error -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace @@ -900,33 +896,33 @@ SET SESSION debug_dbug="+d,ib_import_internal_error"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; # Test failure after reset of space id and LSN in the tablespace -CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after reset of space id and LSN in the tablespace @@ -935,12 +931,12 @@ SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug=@saved_debug_dbug; @@ -948,17 +944,16 @@ SET SESSION debug_dbug=@saved_debug_dbug; # Test failure after attempting a tablespace open SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; ---replace_regex /file: '.*t1.ibd'/'t1.ibd'/ - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after ibuf check @@ -966,73 +961,73 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; # Need proper mapping of error codes :-( --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after adjusting the cluster index root page SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_cluster_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the secondary index(es) SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF # Test failure after importing the cluster index SET SESSION debug_dbug="+d,ib_import_set_max_rowid_failure"; --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; # Left over from the failed IMPORT perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -DROP TABLE test_wl5522.t1; +DROP TABLE t1; --disable_query_log # Enable metrics for the counters we are going to use @@ -1046,7 +1041,7 @@ set global innodb_monitor_enable = ibuf_merges_insert; # Create a large table with delete marked records, disable purge during # the update so that we can test the IMPORT purge code. # -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -1066,53 +1061,45 @@ SET GLOBAL innodb_disable_background_merge=ON; SET GLOBAL innodb_monitor_reset = ibuf_merges; SET GLOBAL innodb_monitor_reset = ibuf_merges_insert; -INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES - (1, REPEAT('a', 2048), REPEAT('a', 2048)), - (2, REPEAT('b', 2048), REPEAT('b', 2048)), - (3, REPEAT('c', 2048), REPEAT('c', 2048)), - (4, REPEAT('d', 2048), REPEAT('d', 2048)); - -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1; - -DELETE FROM test_wl5522.t1 WHERE c2 = 1; - -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c2 = c2 + c1; -UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024); -UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024); - -SHOW CREATE TABLE test_wl5522.t1; - -SELECT c1, c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), + REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; + +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); + +SHOW CREATE TABLE t1; + +SELECT c1, c2 FROM t1; +SELECT COUNT(*) FROM t1; +SELECT SUM(c2) FROM t1; SELECT name FROM information_schema.innodb_metrics WHERE name = 'ibuf_merges_insert' AND count = 0; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; @@ -1133,9 +1120,9 @@ COMMIT; disconnect purge_control; connection default; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 ( +CREATE TABLE t1 ( c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 BIGINT, c3 VARCHAR(2048), @@ -1144,65 +1131,59 @@ CREATE TABLE test_wl5522.t1 ( INDEX idx2(c3(512)), INDEX idx3(c4(512))) Engine=InnoDB; -SELECT c1, c2 FROM test_wl5522.t1; +SELECT c1, c2 FROM t1; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; -CHECK TABLE test_wl5522.t1; +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; -SELECT c1,c2 FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -SELECT SUM(c2) FROM test_wl5522.t1; +SELECT c1,c2 FROM t1; +SELECT COUNT(*) FROM t1; +SELECT SUM(c2) FROM t1; -SHOW CREATE TABLE test_wl5522.t1; +SHOW CREATE TABLE t1; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; #### # Create a table and save the tablespace and .cfg file, we need to create # a Btree that has several levels -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -INSERT IGNORE INTO test_wl5522.t1 VALUES +INSERT IGNORE INTO t1 VALUES (100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 2731)); -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1; -SELECT COUNT(*) FROM test_wl5522.t1; -FLUSH TABLES test_wl5522.t1 FOR EXPORT; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_backup_tablespaces("test_wl5522", "t1"); +ib_backup_tablespaces("test", "t1"); EOF UNLOCK TABLES; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; @@ -1210,30 +1191,30 @@ SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; @@ -1241,172 +1222,166 @@ SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; ---replace_regex $pathfix - --error ER_INNODB_INDEX_CORRUPT -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; ---replace_regex $pathfix - --error ER_NOT_KEYFILE -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; -ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1); +ALTER TABLE t1 ADD INDEX idx(c1); SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fil_space_create_failure"; ---replace_regex $pathfix - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; ---replace_regex $pathfix - +--replace_result \\ / --error ER_GET_ERRMSG -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF # -CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb; -ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE; +ALTER TABLE t1 DISCARD TABLESPACE; --error ER_TABLESPACE_DISCARDED -SELECT COUNT(*) FROM test_wl5522.t1; +SELECT COUNT(*) FROM t1; # Restore files perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_restore_tablespaces("test_wl5522", "t1"); +ib_restore_tablespaces("test", "t1"); EOF SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; @@ -1414,20 +1389,17 @@ SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; --replace_regex /'.*t1.cfg'/'t1.cfg'/ --error ER_INTERNAL_ERROR -ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE; +ALTER TABLE t1 IMPORT TABLESPACE; SET SESSION debug_dbug=@saved_debug_dbug; -DROP TABLE test_wl5522.t1; +DROP TABLE t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; -ib_unlink_tablespace("test_wl5522", "t1"); +ib_unlink_tablespace("test", "t1"); EOF - -DROP DATABASE test_wl5522; - set global innodb_monitor_disable = all; set global innodb_monitor_reset_all = all; @@ -1451,12 +1423,10 @@ call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tabl call mtr.add_suppression(".*There was an error writing to the meta data file.*"); call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file"); call mtr.add_suppression("Unsupported tablespace format"); -call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\""); call mtr.add_suppression("Page is marked as free"); call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted"); call mtr.add_suppression("but tablespace with that id or name does not exist"); -call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache"); -call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'"); +call mtr.add_suppression("Could not find a valid tablespace file for '.*t1'"); call mtr.add_suppression("while reading index meta-data, expected to read 44 bytes but read only 0 bytes"); call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it"); --enable_query_log @@ -1465,4 +1435,4 @@ call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it"); --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg --remove_file $MYSQLTEST_VARDIR/tmp/t1.ibd -eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table; +SET GLOBAL INNODB_FILE_PER_TABLE=@file_per_table; diff --git a/mysql-test/suite/innodb/t/innodb-wl5522.test b/mysql-test/suite/innodb/t/innodb-wl5522.test index 24dad21b3af..2b836bfc985 100644 --- a/mysql-test/suite/innodb/t/innodb-wl5522.test +++ b/mysql-test/suite/innodb/t/innodb-wl5522.test @@ -2,8 +2,9 @@ --source include/not_embedded.inc -- source include/have_innodb.inc +-- source include/have_sequence.inc -call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT."); +call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\."); call mtr.add_suppression("Index for table 't2' is corrupt; try to repair it"); FLUSH TABLES; @@ -17,17 +18,14 @@ CREATE TABLE t1 KEY (b)) ENGINE = InnoDB; -insert into t1 (b, c) values ('Apa', 'Filler........'), +CREATE TEMPORARY TABLE t (b char(22),c varchar(255)); +INSERT INTO t VALUES +('Apa', 'Filler........'), ('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'), ('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg'); -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; -INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; +INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128; +DROP TEMPORARY TABLE t; SELECT COUNT(*) FROM t1; SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; SELECT * FROM t1 ORDER BY a DESC LIMIT 3; @@ -106,16 +104,11 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -157,15 +150,10 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; --list_files $MYSQLD_DATADIR/test FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -176,9 +164,6 @@ UNLOCK TABLES; --list_files $MYSQLD_DATADIR/test # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -211,14 +196,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -227,9 +207,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -262,14 +239,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; FLUSH TABLES t1 FOR EXPORT; -SELECT COUNT(*) FROM t1 WHERE c2 = 1; perl; do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl"; ib_backup_tablespaces("test", "t1"); @@ -277,9 +249,6 @@ EOF UNLOCK TABLES; # Move the LSN forward -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - DROP TABLE t1; CREATE TABLE t1( @@ -329,14 +298,7 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; - -SELECT COUNT(*) FROM t1; - +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; # This should fail, InnoDB should return a warning @@ -356,15 +318,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -491,15 +447,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -644,15 +594,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPACT; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -798,15 +742,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -952,15 +890,9 @@ CREATE TABLE t1( c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, c2 INT, INDEX idx(c2)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; -INSERT INTO t1(c2) VALUES(1); -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; -INSERT INTO t1(c2) SELECT c2 FROM t1; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; SHOW CREATE TABLE t1; -SELECT * FROM t1; FLUSH TABLES t1 FOR EXPORT; @@ -1125,9 +1057,8 @@ SELECT * FROM t1; DROP TABLE t1; call mtr.add_suppression("Got error -1 when reading table '.*'"); -call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*"); +call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'"); call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); -FLUSH TABLES; # cleanup --remove_file $MYSQLTEST_VARDIR/tmp/t1.cfg diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.opt b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.opt new file mode 100644 index 00000000000..948d874d23d --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.opt @@ -0,0 +1,3 @@ +--innodb-buffer-pool-size=64M +--skip-innodb-buffer-pool-load-at-startup +--skip-innodb-buffer-pool-dump-at-shutdown diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test new file mode 100644 index 00000000000..baced6e9e11 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_load_now.test @@ -0,0 +1,190 @@ +#Want to skip this test from daily Valgrind execution +--source include/no_valgrind_without_big.inc +# +# Test for the functionality of InnoDB Buffer Pool dump/load. +# + +# This case checks buffer pool dump/load works as expected +# with innodb_buffer_pool_dump_now=ON +# and innodb_buffer_pool_load_now=ON + +--source include/have_innodb.inc +# include/restart_mysqld.inc does not work in embedded mode +--source include/not_embedded.inc +--source include/have_sequence.inc + +--let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)` + +--error 0,1 +--remove_file $file + +# Dump the whole buffer pool because if only a portion of it is dumped, we +# cannot be sure how many of the ib_bp_test's pages will end up in the dump. +SET GLOBAL innodb_buffer_pool_dump_pct=100; + +# Create a table and populate it with some data +CREATE TABLE ib_bp_test +(a INT AUTO_INCREMENT, b VARCHAR(64), c TEXT, PRIMARY KEY (a), KEY (b, c(128))) +ENGINE=INNODB; + +SELECT PAGE_NUMBER FROM information_schema.innodb_buffer_page_lru +WHERE table_name = '`test`.`ib_bp_test`'; + +SELECT SPACE INTO @space FROM information_schema.innodb_buffer_page_lru +WHERE table_name = '`test`.`ib_bp_test`' AND PAGE_NUMBER=3; + +let SPACE=`SELECT @space`; + +INSERT INTO ib_bp_test +SELECT NULL, REPEAT('b', 64), REPEAT('c', 256) FROM seq_1_to_16382; + +SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru +WHERE table_name = '`test`.`ib_bp_test`'; + +# Dump +SET GLOBAL innodb_buffer_pool_dump_now = ON; + +# Wait for the dump to complete +--disable_warnings +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) dump completed at ' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_dump_status'; +--enable_warnings +--source include/wait_condition.inc + +# Confirm the file has been created +--file_exists $file + +# Add some garbage records to the dump file +--let IBDUMPFILE = $file +perl; +my $fn = $ENV{'IBDUMPFILE'}; +open(my $fh, '>>', $fn) || die "perl open($fn): $!"; +print $fh "123456,0\n"; +print $fh "0,123456\n"; +print $fh "123456,123456\n"; +close($fh); +EOF + +--move_file $file $file.now + +# Complete purge (and change buffer merge). +SET GLOBAL innodb_fast_shutdown=0; +--source include/shutdown_mysqld.inc + +# Make sure no dump after shutdown +--error 1 +--file_exists $file + +--source include/start_mysqld.inc + +--move_file $file.now $file + +# See that we have no pages in the LRU +SELECT PAGE_NUMBER FROM information_schema.innodb_buffer_page_lru +WHERE table_name = '`test`.`ib_bp_test`'; + +# Load the table so that entries in the I_S table do not appear as NULL +select count(*) from ib_bp_test LIMIT 0; + +# Load +SET GLOBAL innodb_buffer_pool_load_now = ON; + +# Wait for the load to complete +--disable_warnings +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at ' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--enable_warnings +--source include/wait_condition.inc + +# Show the status, interesting if the above timed out +--disable_warnings +--replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/ +SELECT variable_value +FROM information_schema.global_status +WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--enable_warnings + +SELECT COUNT(*) FROM information_schema.innodb_buffer_page_lru +WHERE table_name = '`test`.`ib_bp_test`'; + +# Add some total garbage to the dump file +--let IBDUMPFILE = $file +perl; +my $fn = $ENV{'IBDUMPFILE'}; +open(my $fh, '>>', $fn) || die "perl open($fn): $!"; +print $fh "abcdefg\n"; +close($fh); +EOF + +call mtr.add_suppression("InnoDB: Error parsing"); + +# Load +SET GLOBAL innodb_buffer_pool_load_now = ON; + +# Wait for the load to fail +--disable_warnings +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 13) = 'Error parsing' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--enable_warnings +--source include/wait_condition.inc + +--echo # Re-write some valid pages to the dump file, make sure the space +--echo # should be valid but all the page no should be out of bound of the file +--let IBDUMPFILE = $file +perl; +my $fn = $ENV{'IBDUMPFILE'}; +my $space = $ENV{'SPACE'}; +open(my $fh, '>', $fn) || die "perl open($fn): $!"; +print $fh "$space,10000\n"; +print $fh "$space,10001\n"; +print $fh "$space,10002\n"; +close($fh); +EOF + +# We force the restart so that the table would be closed +--source include/restart_mysqld.inc + +# Load directly, without accessing the table first +SET GLOBAL innodb_buffer_pool_load_now = ON; + +# Wait for the load to complete +--disable_warnings +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 33) = 'Buffer pool(s) load completed at ' + FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--enable_warnings +--source include/wait_condition.inc + +# Show the status, interesting if the above timed out +--disable_warnings +--replace_regex /[0-9]{6}[[:space:]]+[0-9]{1,2}:[0-9]{2}:[0-9]{2}/TIMESTAMP_NOW/ +SELECT variable_value +FROM information_schema.global_status +WHERE LOWER(variable_name) = 'innodb_buffer_pool_load_status'; +--enable_warnings + +DROP TABLE ib_bp_test; +SET GLOBAL innodb_buffer_pool_dump_pct=default; + +--echo # +--echo # Bug#21371070 [ERROR] INNODB: CANNOT ALLOCATE 0 BYTES: SUCCESS +--echo # + +--let $file = `SELECT CONCAT(@@datadir, @@global.innodb_buffer_pool_filename)` + +# Remove the buffer pool file that exists already +--error 0,1 +--remove_file $file + +# Create an empty buffer pool file +write_file $file; +EOF + +SET GLOBAL innodb_buffer_pool_load_now = ON; diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.opt b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.opt new file mode 100644 index 00000000000..dca040ea893 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.opt @@ -0,0 +1 @@ +--innodb-buffer-pool-size=8M --innodb-buffer-pool-chunk-size=2M diff --git a/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test new file mode 100644 index 00000000000..d1e17c7622a --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb_buffer_pool_resize_debug.test @@ -0,0 +1,241 @@ +# +# WL6117 : Resize the InnoDB Buffer Pool Online +# (concurrent sql; allocation fail;) +# + +--source include/have_innodb.inc +--source include/have_debug.inc + +--disable_query_log +set @old_innodb_buffer_pool_size = @@innodb_buffer_pool_size; +set @old_innodb_file_per_table = @@innodb_file_per_table; +set @old_innodb_thread_concurrency = @@innodb_thread_concurrency; +set @old_innodb_thread_sleep_delay = @@innodb_thread_sleep_delay; +set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug; +set global innodb_disable_resize_buffer_pool_debug = OFF; +--enable_query_log + +# Save the initial number of concurrent sessions +--source include/count_sessions.inc + +let $wait_timeout = 180; + +set global innodb_file_per_table=ON; +set global innodb_thread_concurrency=20; + +connect (con1,localhost,root,,); +connect (con2,localhost,root,,); +connect (con3,localhost,root,,); +connect (con4,localhost,root,,); +connect (con5,localhost,root,,); +connect (con6,localhost,root,,); +connect (con7,localhost,root,,); +connect (con8,localhost,root,,); + +create table t2 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t2 (c1, c2) values (1, 1); + +create table t3 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t3 (c1, c2) values (1, 1); + +create table t4 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t4 (c1, c2) values (1, 1); + +create table t5 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t5 (c1, c2) values (1, 1); + +create table t6 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t6 (c1, c2) values (1, 1); + +create database test2; +create table test2.t7 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into test2.t7 (c1, c2) values (1, 1); +drop table test2.t7; + +connection con1; +set @save_dbug=@@global.debug_dbug; +set global debug_dbug="+d,ib_buf_pool_resize_wait_before_resize"; +set global innodb_buffer_pool_size = 12*1024*1024; + +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 30) = 'Latching whole of buffer pool.' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +# trying to update innodb_buffer_pool_size +--error ER_WRONG_ARGUMENTS +set global innodb_buffer_pool_size = 8*1024*1024; +select @@global.innodb_buffer_pool_size; + +# trying to control adaptive hash index +select @@global.innodb_adaptive_hash_index; +set global innodb_adaptive_hash_index = ON; +select @@global.innodb_adaptive_hash_index; +set global innodb_adaptive_hash_index = OFF; +select @@global.innodb_adaptive_hash_index; + +# - create table +--send create table t1 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB + +connection con2; +# - analyze table +--send analyze table t2 + +connection con3; +# - alter table ... algorithm=inplace +--send alter table t3 algorithm=inplace, add index idx (c1) + +connection con4; +# - alter table ... rename to +--send alter table t4 rename to t0 + +connection con5; +# - drop table +--send drop table t5 + +connection con6; +# - alter table ... discard tablespace +--send alter table t6 discard tablespace + +connection con7; +# - drop database +--send drop database test2 + +connection con8; +# information schema INNODB_BUFFER_PAGE +--send select count(*) > 0 from information_schema.innodb_buffer_page + +connection default; +set global debug_dbug=@save_dbug; + +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at ' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +connection con1; +--reap + +connection con2; +--reap + +connection con3; +--reap + +connection con4; +--reap + +connection con5; +--reap + +connection con6; +--reap + +connection con7; +--reap + +connection con8; +--reap + +connection default; + +disconnect con3; +disconnect con4; +disconnect con5; +disconnect con6; +disconnect con7; +disconnect con8; +disconnect con1; +disconnect con2; + +# fails to allocate new chunks +call mtr.add_suppression("\\[ERROR\\] InnoDB: buffer pool 0 : failed to allocate new memory."); +connection default; +set global debug_dbug="+d,ib_buf_chunk_init_fails"; +set global innodb_buffer_pool_size = 16*1024*1024; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 27) = 'Resizing buffer pool failed' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc +set global debug_dbug=@save_dbug; + +# can be used as usual, even if failed to allocate +create table t8 (c1 int not null primary key, c2 int not null default 0) engine=InnoDB; +insert into t8 (c1, c2) values (1, 1); +drop table t8; + +drop table t1; +drop table t2; +drop table t3; +drop table t0; +drop table t6; + +--disable_query_log +set global innodb_buffer_pool_size = @old_innodb_buffer_pool_size; +set global innodb_file_per_table = @old_innodb_file_per_table; +set global innodb_thread_concurrency = @old_innodb_thread_concurrency; +set global innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; +set global innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize; +--enable_query_log + +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 34) = 'Completed resizing buffer pool at ' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +# Wait till all disconnects are completed] +--source include/wait_until_count_sessions.inc + +--echo # +--echo # BUG#23590280 NO WARNING WHEN REDUCING INNODB_BUFFER_POOL_SIZE INSIZE THE FIRST CHUNK +--echo # + +SET @save_disable = @@GLOBAL.innodb_disable_background_merge; +SET GLOBAL innodb_disable_background_merge = ON; + +set @old_innodb_disable_resize = @@innodb_disable_resize_buffer_pool_debug; +set global innodb_disable_resize_buffer_pool_debug = OFF; +set @before_innodb_buffer_pool_size = @@innodb_buffer_pool_size; + +set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size; + +let $wait_timeout = 60; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change' + FROM information_schema.global_status + WHERE VARIABLE_NAME = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size * 2; + +let $wait_timeout = 60; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 9) = 'Completed' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size; + +let $wait_timeout = 60; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 9) = 'Completed' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +set global innodb_buffer_pool_size=@before_innodb_buffer_pool_size; + +let $wait_timeout = 60; +let $wait_condition = + SELECT SUBSTR(variable_value, 1, 19) = 'Size did not change' + FROM information_schema.global_status + WHERE variable_name = 'INNODB_BUFFER_POOL_RESIZE_STATUS'; +--source include/wait_condition.inc + +SET GLOBAL innodb_disable_resize_buffer_pool_debug = @old_innodb_disable_resize; +SET GLOBAL innodb_disable_background_merge = @save_disable; diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test index bbcd72f1a3a..1e4e14eb7c6 100644 --- a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test +++ b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test @@ -2,17 +2,13 @@ --source include/big_test.inc --source include/not_valgrind.inc --source include/not_embedded.inc +--source include/have_sequence.inc ---disable_warnings -DROP TABLE if exists t1; ---enable_warnings +SET @n_pages= @@GLOBAL.innodb_defragment_n_pages; +SET @accuracy= @@GLOBAL.innodb_defragment_stats_accuracy; +SET @sp= @@GLOBAL.innodb_stats_persistent; ---disable_query_log -let $innodb_defragment_n_pages_orig=`select @@innodb_defragment_n_pages`; -let $innodb_defragment_stats_accuracy_orig=`select @@innodb_defragment_stats_accuracy`; ---enable_query_log - -select @@global.innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent = 0; set global innodb_defragment_stats_accuracy = 80; # Create table. @@ -46,6 +42,12 @@ connection default; SET @@global.innodb_defragment_n_pages = 20; +CREATE TEMPORARY TABLE tt (a INT, KEY(a)) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; +INSERT INTO tt SELECT 0 FROM seq_1_to_180; +INSERT INTO tt SELECT 5 FROM seq_1_to_160; +INSERT INTO tt SELECT 1 FROM seq_1_to_1000; +OPTIMIZE TABLE tt; + let $data_size = 20000; let $delete_size = 2000; @@ -60,7 +62,7 @@ while ($i) } --enable_query_log -select count(*) from t1; +select count(*) from t1; select count(*) from t1 force index (second); select count(*) from t1 force index (third); @@ -75,7 +77,7 @@ while ($size) } --enable_query_log -select count(*) from t1; +select count(*) from t1; select count(*) from t1 force index (second); select count(*) from t1 force index (third); @@ -136,7 +138,6 @@ select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like drop table t1; # reset system ---disable_query_log -EVAL SET GLOBAL innodb_defragment_n_pages = $innodb_defragment_n_pages_orig; -EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig; ---enable_query_log +SET GLOBAL innodb_defragment_n_pages = @n_pages; +SET GLOBAL innodb_defragment_stats_accuracy = @accuracy; +SET GLOBAL innodb_stats_persistent = @sp; |