From 3969d97e6ac29025a5ae1b425339e075546bc3f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Thu, 8 Feb 2018 14:55:01 +0200 Subject: [PATCH] MDEV-14427: encryption.innodb-bad-key-change failed in buildbot Timing problem as sometimes table is marked as encrypted but sometimes we are not sure and table is just marked missing. --- .../encryption/r/innodb-bad-key-change.result | 39 ------------------ .../encryption/t/innodb-bad-key-change.test | 41 +++++++------------ 2 files changed, 15 insertions(+), 65 deletions(-) diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change.result b/mysql-test/suite/encryption/r/innodb-bad-key-change.result index 71ad4909899..1c64ac9a6c3 100644 --- a/mysql-test/suite/encryption/r/innodb-bad-key-change.result +++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result @@ -27,16 +27,9 @@ foobar 2 # Restart server with keysbad3.txt SELECT * FROM t1; ERROR 42S02: Table 'test.t1' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1932 Table 'test.t1' doesn't exist in engine DROP TABLE t1; Warnings: Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -SHOW WARNINGS; -Level Code Message -Warning 192 Table test/t1 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. # Start server with keys3.txt SET GLOBAL innodb_default_encryption_key_id=5; CREATE TABLE t2 (c VARCHAR(8), id int not null primary key, b int, key(b)) ENGINE=InnoDB ENCRYPTED=YES; @@ -45,62 +38,30 @@ INSERT INTO t2 VALUES ('foobar',1,2); # Restart server with keys2.txt SELECT * FROM t2; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Warning 192 Table test/t2 in tablespace is encrypted but encryption service or used key_id is not available. Can't continue reading table. -Error 1932 Table 'test.t2' doesn't exist in engine SELECT * FROM t2 where id = 1; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine SELECT * FROM t2 where b = 1; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine INSERT INTO t2 VALUES ('tmp',3,3); ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine DELETE FROM t2 where b = 3; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine DELETE FROM t2 where id = 3; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine UPDATE t2 set b = b +1; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine OPTIMIZE TABLE t2; Table Op Msg_type Msg_text test.t2 optimize Error Table 'test.t2' doesn't exist in engine test.t2 optimize status Operation failed -SHOW WARNINGS; -Level Code Message ALTER TABLE t2 ADD COLUMN d INT; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine ANALYZE TABLE t2; Table Op Msg_type Msg_text test.t2 analyze Error Table 'test.t2' doesn't exist in engine test.t2 analyze status Operation failed -SHOW WARNINGS; -Level Code Message TRUNCATE TABLE t2; ERROR 42S02: Table 'test.t2' doesn't exist in engine -SHOW WARNINGS; -Level Code Message -Error 1932 Table 'test.t2' doesn't exist in engine DROP TABLE t2; # Start server with keys2.txt diff --git a/mysql-test/suite/encryption/t/innodb-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test index 8a431cd93ca..a32d043dd3b 100644 --- a/mysql-test/suite/encryption/t/innodb-bad-key-change.test +++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test @@ -37,17 +37,16 @@ SELECT * FROM t1; -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt -- source include/restart_mysqld.inc +--disable_warnings --error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t1; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; +--enable_warnings -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt -- source include/restart_mysqld.inc + --replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / DROP TABLE t1; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; # # MDEV-8591: Database page corruption on disk or a failed space, Assertion failure in file buf0buf.cc @@ -67,50 +66,40 @@ INSERT INTO t2 VALUES ('foobar',1,2); -- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt -- source include/restart_mysqld.inc +--disable_warnings --error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2 where id = 1; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE SELECT * FROM t2 where b = 1; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE INSERT INTO t2 VALUES ('tmp',3,3); ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE DELETE FROM t2 where b = 3; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE DELETE FROM t2 where id = 3; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE UPDATE t2 set b = b +1; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + OPTIMIZE TABLE t2; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE ALTER TABLE t2 ADD COLUMN d INT; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + ANALYZE TABLE t2; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; + --error ER_NO_SUCH_TABLE_IN_ENGINE TRUNCATE TABLE t2; ---replace_regex /(tablespace|key_id) [1-9][0-9]*/\1 / -SHOW WARNINGS; DROP TABLE t2; +--enable_warnings --echo --echo # Start server with keys2.txt