1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2020-03-20 22:06:55 +02:00
81 changed files with 2790 additions and 2803 deletions

View File

@ -12,70 +12,66 @@
--source include/innodb_page_size_small.inc
--source include/default_charset.inc
--source include/have_sequence.inc
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file .*");
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded\\.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue\\.");
call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file");
call mtr.add_suppression("InnoDB: Page for tablespace ");
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x");
FLUSH TABLES;
let MYSQLD_DATADIR =`SELECT @@datadir`;
let $pathfix=/: '.*test_wl5522.*t1.ibd'/: 'test_wl5522_t1.ibd'/;
SET SESSION innodb_strict_mode=1;
CREATE DATABASE test_wl5522;
# Create the table that we will use for crash recovery (during IMPORT)
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
CREATE TABLE t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1), (2), (3), (4);
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}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
CREATE TABLE t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
INSERT INTO test_wl5522.t1 VALUES (1);
INSERT INTO t1 VALUES (1);
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_discard_tablespaces("test_wl5522", "t1");
ib_discard_tablespaces("test", "t1");
EOF
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
##### Before commit crash
SET SESSION debug_dbug="+d,ib_import_before_commit_crash";
--error ER_TABLESPACE_DISCARDED
SELECT * FROM test_wl5522.t1;
SELECT * FROM t1;
# Write file to make mysql-test-run.pl start up the server again
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
--enable_reconnect
--source include/wait_until_connected_again.inc
@ -89,14 +85,14 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash";
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Don't start up the server right away.
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
# Execute the statement that causes the crash
--error 2013
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
# After the above test the results are non-deterministic,
# delete the old tablespace files and drop the table,
@ -104,7 +100,7 @@ ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
-- source include/wait_until_disconnected.inc
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
--echo # Restart and reconnect to the server
@ -118,95 +114,91 @@ EOF
# After the above test the results are non-deterministic, recreate the table
# and do a proper import.
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
SET SESSION innodb_strict_mode=1;
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
CREATE TABLE t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
INSERT INTO test_wl5522.t1 VALUES(400), (500), (600);
INSERT INTO t1 VALUES(400), (500), (600);
SELECT * FROM test_wl5522.t1;
SELECT * FROM t1;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
# Test handling of internal failure error
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
CREATE TABLE t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after reset of space id and LSN in the tablespace
SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,ib_import_internal_error";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
# Test failure after reset of space id and LSN in the tablespace
CREATE TABLE test_wl5522.t1 (c1 INT) ENGINE = Innodb
CREATE TABLE t1 (c1 INT) ENGINE = Innodb
ROW_FORMAT=COMPRESSED;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after reset of space id and LSN in the tablespace
SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug=@saved_debug_dbug;
@ -214,16 +206,16 @@ SET SESSION debug_dbug=@saved_debug_dbug;
# Test failure after attempting a tablespace open
SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure";
--replace_regex /'.*[\/\\]/'/
--replace_result \\ /
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after ibuf check
@ -231,59 +223,59 @@ SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure";
# Need proper mapping of error codes :-(
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after adjusting the cluster index root page
SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after importing the cluster index
SET SESSION debug_dbug="+d,ib_import_cluster_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
# Test failure after importing the secondary index(es)
SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure";
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
--disable_query_log
# Enable metrics for the counters we are going to use
@ -297,7 +289,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),
@ -318,64 +310,45 @@ SET GLOBAL innodb_disable_background_merge=ON;
SET GLOBAL innodb_monitor_reset = ibuf_merges;
SET GLOBAL innodb_monitor_reset = ibuf_merges_insert;
INSERT INTO test_wl5522.t1(c2, c3, c4) VALUES
(1, REPEAT('a', 2048), REPEAT('a', 2048)),
(2, REPEAT('b', 2048), REPEAT('b', 2048)),
(3, REPEAT('c', 2048), REPEAT('c', 2048)),
(4, REPEAT('d', 2048), REPEAT('d', 2048));
INSERT INTO t1
SELECT 1 + seq, 1 + (seq MOD 4),
REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048),
REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048)
FROM seq_0_to_127;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1(c2, c3, c4) SELECT c2, c3, c4 FROM test_wl5522.t1;
DELETE FROM t1 WHERE c2 = 1;
DELETE FROM test_wl5522.t1 WHERE c2 = 1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c2 = c2 + c1;
UPDATE t1 SET c3 = REPEAT("c2", 1024);
UPDATE t1 SET c4 = REPEAT("c4", 1024);
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c2 = c2 + c1;
UPDATE test_wl5522.t1 SET c3 = REPEAT("c2", 1024);
UPDATE test_wl5522.t1 SET c4 = REPEAT("c4", 1024);
SHOW CREATE TABLE t1;
SHOW CREATE TABLE test_wl5522.t1;
SELECT c1, c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_insert' AND count = 0;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
FLUSH TABLES t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges' AND count > 0;
SELECT name
FROM information_schema.innodb_metrics
WHERE name = 'ibuf_merges_inserts' AND count > 0;
SELECT name FROM information_schema.innodb_metrics
WHERE name IN ('ibuf_merges','ibuf_merges_insert') AND count>0 ORDER BY name;
SET GLOBAL innodb_disable_background_merge=OFF;
@ -385,9 +358,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),
@ -397,296 +370,272 @@ CREATE TABLE test_wl5522.t1 (
INDEX idx3(c4(512))) Engine=InnoDB
ROW_FORMAT=COMPRESSED;
SELECT c1, c2 FROM test_wl5522.t1;
SELECT c1, c2 FROM t1;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
CHECK TABLE test_wl5522.t1;
ALTER TABLE t1 IMPORT TABLESPACE;
CHECK TABLE t1;
SELECT c1,c2 FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT SUM(c2) FROM test_wl5522.t1;
SELECT c1,c2 FROM t1;
SHOW CREATE TABLE test_wl5522.t1;
SHOW CREATE TABLE t1;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
####
# Create a table and save the tablespace and .cfg file, we need to create
# a Btree that has several levels
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT IGNORE INTO test_wl5522.t1 VALUES
(100, REPEAT('Karanbir', 899), REPEAT('Ajeeth', 1200));
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
INSERT INTO test_wl5522.t1 SELECT * FROM test_wl5522.t1;
SELECT COUNT(*) FROM test_wl5522.t1;
FLUSH TABLES test_wl5522.t1 FOR EXPORT;
INSERT INTO t1
SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200)
FROM seq_1_to_256;
FLUSH TABLES t1 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test_wl5522", "t1");
ib_backup_tablespaces("test", "t1");
EOF
UNLOCK TABLES;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,buf_page_import_corrupt_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
# Following alter is failing
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2";
--replace_regex $pathfix
--error ER_INNODB_INDEX_CORRUPT
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_NOT_KEYFILE
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
SET SESSION debug_dbug="+d,ib_import_create_index_failure_1";
ALTER TABLE test_wl5522.t1 ADD INDEX idx(c1);
ALTER TABLE t1 ADD INDEX idx(c1);
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,fil_space_create_failure";
--replace_regex /'.*[\/\\]/'/
--replace_result \\ /
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure";
--replace_regex /'.*[\/\\]/'/
--replace_result \\ /
--error ER_GET_ERRMSG
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
#
CREATE TABLE test_wl5522.t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb
ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
ALTER TABLE test_wl5522.t1 DISCARD TABLESPACE;
ALTER TABLE t1 DISCARD TABLESPACE;
--error ER_TABLESPACE_DISCARDED
SELECT COUNT(*) FROM test_wl5522.t1;
SELECT COUNT(*) FROM t1;
# Restore files
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_restore_tablespaces("test_wl5522", "t1");
ib_restore_tablespaces("test", "t1");
EOF
SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure";
--replace_regex /'.*t1.cfg'/'t1.cfg'/
--error ER_INTERNAL_ERROR
ALTER TABLE test_wl5522.t1 IMPORT TABLESPACE;
ALTER TABLE t1 IMPORT TABLESPACE;
SET SESSION debug_dbug=@saved_debug_dbug;
DROP TABLE test_wl5522.t1;
DROP TABLE t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_unlink_tablespace("test_wl5522", "t1");
ib_unlink_tablespace("test", "t1");
EOF
DROP DATABASE test_wl5522;
set global innodb_monitor_disable = all;
set global innodb_monitor_reset_all = all;
@ -703,18 +652,16 @@ call mtr.add_suppression("Monitor ibuf_merges is already enabled");
call mtr.add_suppression("Monitor ibuf_merges_insert is already enabled");
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Table '.*' tablespace is set as discarded.");
call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache.*");
call mtr.add_suppression("InnoDB: Tablespace '.*' exists in the cache");
call mtr.add_suppression("InnoDB: Freeing existing tablespace '.*' entry from the cache with id.*");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
call mtr.add_suppression(".*There was an error writing to the meta data file.*");
call mtr.add_suppression("There was an error writing to the meta data file");
call mtr.add_suppression("InnoDB: Trying to import a tablespace, but could not open the tablespace file");
call mtr.add_suppression("Unsupported tablespace format");
call mtr.add_suppression("Error in page .* of index \"GEN_CLUST_INDEX\" of table \"test_wl5522\".\"t1\"");
call mtr.add_suppression("Page is marked as free");
call mtr.add_suppression("t1.ibd: Page .* at offset .* looks corrupted");
call mtr.add_suppression("but tablespace with that id or name does not exist");
call mtr.add_suppression("Failed to find tablespace for table '\"test_wl5522\".\"t1\"' in the cache");
call mtr.add_suppression("Could not find a valid tablespace file for 'test_wl5522.*t1'");
call mtr.add_suppression("Could not find a valid tablespace file for '.*t1'");
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
--enable_query_log

View File

@ -2,8 +2,9 @@
--source include/not_embedded.inc
-- source include/innodb_page_size_small.inc
-- source include/have_sequence.inc
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\.");
SET SESSION innodb_strict_mode=1;
@ -17,17 +18,14 @@ CREATE TABLE t1
KEY (b))
ENGINE = InnoDB ROW_FORMAT=COMPRESSED ;
insert into t1 (b, c) values ('Apa', 'Filler........'),
CREATE TEMPORARY TABLE t (b char(22),c varchar(255));
INSERT INTO t VALUES
('Apa', 'Filler........'),
('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'),
('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg');
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a;
INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128;
DROP TEMPORARY TABLE t;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3;
SELECT * FROM t1 ORDER BY a DESC LIMIT 3;
@ -89,16 +87,11 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
@ -140,11 +133,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
--list_files $MYSQLD_DATADIR/test
FLUSH TABLES t1 FOR EXPORT;
@ -159,9 +148,6 @@ UNLOCK TABLES;
--list_files $MYSQLD_DATADIR/test
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
@ -195,14 +181,9 @@ CREATE TABLE t1(
c2 INT, INDEX(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
@ -211,9 +192,6 @@ EOF
UNLOCK TABLES;
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
CREATE TABLE t1(
@ -250,14 +228,9 @@ eval CREATE TABLE t1(
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED $KEY_BLOCK_SIZE;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
FLUSH TABLES t1 FOR EXPORT;
SELECT COUNT(*) FROM t1 WHERE c2 = 1;
perl;
do "$ENV{MTR_SUITE_DIR}/../innodb/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1");
@ -265,9 +238,6 @@ EOF
UNLOCK TABLES;
# Move the LSN forward
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
DROP TABLE t1;
--replace_result $KEY_BLOCK_SIZE KEY_BLOCK_SIZE=16
@ -319,14 +289,7 @@ CREATE TABLE t1(
c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
c2 INT) ENGINE=InnoDB;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
SHOW CREATE TABLE t1;
# This should fail, InnoDB should return a warning
@ -347,15 +310,9 @@ CREATE TABLE t1(
c2 INT, INDEX idx(c2)) ENGINE=InnoDB
ROW_FORMAT=COMPRESSED;
INSERT INTO t1(c2) VALUES(1);
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1(c2) SELECT c2 FROM t1;
INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
FLUSH TABLES t1 FOR EXPORT;
@ -511,7 +468,7 @@ SELECT * FROM t1;
DROP TABLE t1;
call mtr.add_suppression("Got error -1 when reading table '.*'");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'.*");
call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'");
call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded");
# cleanup