summaryrefslogtreecommitdiff
path: root/mysql-test/suite/maria
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2016-02-06 18:14:54 +0200
committerMonty <monty@mariadb.org>2016-02-06 18:14:54 +0200
commitb2f8d7b41001a5da11b2d99a055a207c3911a213 (patch)
treed108ed6d1f38543305235fec6a63228a5a2f08d5 /mysql-test/suite/maria
parentd4b3a199acb0ddcdedff441ae664b0a2cf2fe8d2 (diff)
parent07b8aefe90ca830d2de068f2966cd2288b158a88 (diff)
downloadmariadb-git-b2f8d7b41001a5da11b2d99a055a207c3911a213.tar.gz
Merge branch '10.1' into 10.2
Conflicts: VERSION cmake/plugin.cmake config.h.cmake configure.cmake plugin/server_audit/server_audit.c sql/sql_yacc.yy
Diffstat (limited to 'mysql-test/suite/maria')
-rw-r--r--mysql-test/suite/maria/encrypt-wrong-key.result16
-rw-r--r--mysql-test/suite/maria/encrypt-wrong-key.test54
2 files changed, 70 insertions, 0 deletions
diff --git a/mysql-test/suite/maria/encrypt-wrong-key.result b/mysql-test/suite/maria/encrypt-wrong-key.result
new file mode 100644
index 00000000000..bc22481296d
--- /dev/null
+++ b/mysql-test/suite/maria/encrypt-wrong-key.result
@@ -0,0 +1,16 @@
+call mtr.add_suppression("file_key_management");
+call mtr.add_suppression("System key id 1 is missing");
+call mtr.add_suppression("Unknown key id 1");
+call mtr.add_suppression("Failed to decrypt");
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
+INSERT INTO t1 VALUES (1);
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair info Wrong CRC on datapage at 1
+test.t1 repair warning Number of rows changed from 1 to 0
+test.t1 repair status OK
+INSERT INTO t1 VALUES (2);
+select * from t1;
+ERROR HY000: failed to decrypt './test/t1' rc: -1 dstlen: 0 size: 8172
+
+drop table t1;
diff --git a/mysql-test/suite/maria/encrypt-wrong-key.test b/mysql-test/suite/maria/encrypt-wrong-key.test
new file mode 100644
index 00000000000..6f59952c1fa
--- /dev/null
+++ b/mysql-test/suite/maria/encrypt-wrong-key.test
@@ -0,0 +1,54 @@
+--source include/not_embedded.inc
+
+#
+# Test what happens if one removes a decryption key for Aria
+#
+
+call mtr.add_suppression("file_key_management");
+call mtr.add_suppression("System key id 1 is missing");
+call mtr.add_suppression("Unknown key id 1");
+call mtr.add_suppression("Failed to decrypt");
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys1.txt
+1;770A8A65DA156D24EE2A093277530142
+EOF
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=Aria;
+INSERT INTO t1 VALUES (1);
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--write_file $MYSQLTEST_VARDIR/keys2.txt
+2;770A8A65DA156D24EE2A093277530143
+EOF
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+repair table t1;
+
+INSERT INTO t1 VALUES (2);
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--aria-encrypt-tables=1 --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--replace_result \\ /
+--error 192
+select * from t1;
+drop table t1;