Skip to content

Commit

Permalink
MDEV-14427: encryption.innodb-bad-key-change failed in buildbot
Browse files Browse the repository at this point in the history
Timing problem as sometimes table is marked as encrypted but
sometimes we are not sure and table is just marked missing.
  • Loading branch information
Jan Lindström committed Feb 8, 2018
1 parent 627d33d commit 3969d97
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 65 deletions.
39 changes: 0 additions & 39 deletions mysql-test/suite/encryption/r/innodb-bad-key-change.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
41 changes: 15 additions & 26 deletions mysql-test/suite/encryption/t/innodb-bad-key-change.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3969d97

Please sign in to comment.