summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/encryption
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:39:13 +0000
commit86fbb58c3ac0865482819c10a3e81f2eea001c36 (patch)
tree28c9e526ea739c6f9b89e36115e1e2698bddf981 /mysql-test/suite/encryption
parentReleasing progress-linux version 1:10.11.6-2~progress7.99u1. (diff)
downloadmariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.tar.xz
mariadb-86fbb58c3ac0865482819c10a3e81f2eea001c36.zip
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/encryption')
-rw-r--r--mysql-test/suite/encryption/r/corrupted_during_recovery.result2
-rw-r--r--mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result16
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_discard_import.result67
-rw-r--r--mysql-test/suite/encryption/r/tempfiles_encrypted.result13
-rw-r--r--mysql-test/suite/encryption/t/corrupted_during_recovery.test2
-rw-r--r--mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test12
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption_discard_import.test60
7 files changed, 78 insertions, 94 deletions
diff --git a/mysql-test/suite/encryption/r/corrupted_during_recovery.result b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
index 2b29bf26..7329999d 100644
--- a/mysql-test/suite/encryption/r/corrupted_during_recovery.result
+++ b/mysql-test/suite/encryption/r/corrupted_during_recovery.result
@@ -9,7 +9,7 @@ INSERT INTO t2 VALUES(2);
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'InnoDB'
SELECT * FROM t1;
-ERROR HY000: Table test/t1 is corrupted. Please drop the table and recreate.
+Got one of the listed errors
SELECT * FROM t2;
a
2
diff --git a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
index 541680ae..d86ca6f9 100644
--- a/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
+++ b/mysql-test/suite/encryption/r/innodb_encrypt_temporary_tables.result
@@ -1,6 +1,8 @@
-SELECT variable_value into @old_encrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) INTO @old_encrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
-SELECT variable_value into @old_decrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) INTO @old_decrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
CREATE TEMPORARY TABLE t1(f1 CHAR(200), f2 CHAR(200)) ENGINE=InnoDB;
INSERT INTO t1 (f1,f2) SELECT '', '' FROM seq_1_to_8192;
@@ -12,11 +14,13 @@ COUNT(*)
SELECT COUNT(*) FROM t2;
COUNT(*)
8192
-SELECT variable_value > @old_encrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) > @old_encrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
-variable_value > @old_encrypted
+CAST(variable_value AS INT) > @old_encrypted
1
-SELECT variable_value > @old_decrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) > @old_decrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
-variable_value > @old_decrypted
+CAST(variable_value AS INT) > @old_decrypted
1
diff --git a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
index 7ee30423..18082027 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
@@ -13,11 +13,13 @@ set current_num = current_num + 1;
end while;
end//
commit;
-set autocommit=0;
-call innodb_insert_proc(10000);
+begin;
+set statement unique_checks=0, foreign_key_checks=0 for
+call innodb_insert_proc(100);
commit;
-set autocommit=1;
+DROP PROCEDURE innodb_insert_proc;
# Wait max 10 min for key encryption threads to encrypt all spaces
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
# tablespaces should be now encrypted
# t1 yes on expecting NOT FOUND
NOT FOUND /foobar/ in t1.ibd
@@ -25,15 +27,16 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd
-# restart
db.opt
+t1.cfg
t1.frm
t1.ibd
+t2.cfg
t2.frm
t2.ibd
+t3.cfg
t3.frm
t3.ibd
-FLUSH TABLES t1, t2, t3 FOR EXPORT;
backup: t1
backup: t2
backup: t3
@@ -55,17 +58,18 @@ restore: t1 .ibd and .cfg files
restore: t2 .ibd and .cfg files
restore: t3 .ibd and .cfg files
ALTER TABLE t1 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t1;
-COUNT(1)
-10000
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+100
ALTER TABLE t2 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t2;
-COUNT(1)
-10000
+SELECT COUNT(*) FROM t2;
+COUNT(*)
+100
ALTER TABLE t3 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t3;
-COUNT(1)
-10000
+SELECT COUNT(*) FROM t3;
+COUNT(*)
+100
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
# tablespaces should remain encrypted after import
# t1 yes on expecting NOT FOUND
NOT FOUND /foobar/ in t1.ibd
@@ -73,8 +77,8 @@ NOT FOUND /foobar/ in t1.ibd
NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND
NOT FOUND /barfoo/ in t3.ibd
-# restart
-ALTER TABLE t1 ENGINE InnoDB;
+UNLOCK TABLES;
+ALTER TABLE t1 FORCE;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -82,7 +86,7 @@ t1 CREATE TABLE `t1` (
`a` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci `encrypted`=yes
-ALTER TABLE t2 ENGINE InnoDB;
+ALTER TABLE t2 FORCE;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -90,7 +94,7 @@ t2 CREATE TABLE `t2` (
`a` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
-ALTER TABLE t3 ENGINE InnoDB;
+ALTER TABLE t3 FORCE;
SHOW CREATE TABLE t3;
Table Create Table
t3 CREATE TABLE `t3` (
@@ -98,30 +102,17 @@ t3 CREATE TABLE `t3` (
`a` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED `encrypted`=yes
-# Restarting server
-# restart
-# Done restarting server
# Verify that tables are still usable
-SELECT COUNT(1) FROM t1;
-COUNT(1)
-10000
-SELECT COUNT(1) FROM t2;
-COUNT(1)
-10000
-SELECT COUNT(1) FROM t3;
-COUNT(1)
-10000
-# Tablespaces should be encrypted after restart
+CHECK TABLE t1, t2, t3 EXTENDED;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t2 check status OK
+test.t3 check status OK
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
# t1 yes on expecting NOT FOUND
NOT FOUND /foobar/ in t1.ibd
# t2 ... on expecting NOT FOUND
NOT FOUND /temp/ in t2.ibd
# t3 ... on expecting NOT FOUND
-NOT FOUND /barfoo/ in t3.ibd
-# restart
-# Wait max 10 min for key encryption threads to encrypt all spaces
-# Success!
-# Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
-# restart: --innodb_encrypt_tables=0 --innodb_encryption_threads=0
-DROP PROCEDURE innodb_insert_proc;
+UNLOCK TABLES;
DROP TABLE t1, t2, t3;
diff --git a/mysql-test/suite/encryption/r/tempfiles_encrypted.result b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
index d0dadb6d..6dedcd4b 100644
--- a/mysql-test/suite/encryption/r/tempfiles_encrypted.result
+++ b/mysql-test/suite/encryption/r/tempfiles_encrypted.result
@@ -4502,6 +4502,19 @@ NULL
DROP FUNCTION f;
DROP TABLE t;
#
+# MDEV-31296: Crash in Item_func::fix_fields when prepared statement
+# with subqueries and window function is executed with
+# sql_mode = ONLY_FULL_GROUP_BY
+#
+CREATE TABLE t1 ( a INT, i INT) ;
+CREATE TABLE t2 ( a INT);
+INSERT INTO t2 VALUES (4000);
+SET SESSION sql_mode = "ONLY_FULL_GROUP_BY";
+EXECUTE IMMEDIATE "SELECT SUM(i) OVER (ORDER BY i) FROM t1 NATURAL JOIN t2";
+SUM(i) OVER (ORDER BY i)
+# Clean up
+DROP TABLE t1, t2;
+#
# End of 10.6 tests
#
#
diff --git a/mysql-test/suite/encryption/t/corrupted_during_recovery.test b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
index e4a31a0b..1240ee1a 100644
--- a/mysql-test/suite/encryption/t/corrupted_during_recovery.test
+++ b/mysql-test/suite/encryption/t/corrupted_during_recovery.test
@@ -60,7 +60,7 @@ call mtr.add_suppression("Table .*t1.* is corrupted. Please drop the table and r
let $restart_parameters=--innodb_force_recovery=1 --skip-innodb-buffer-pool-load-at-startup;
--source include/restart_mysqld.inc
---error ER_TABLE_CORRUPT
+--error ER_NO_SUCH_TABLE_IN_ENGINE,ER_TABLE_CORRUPT
SELECT * FROM t1;
SELECT * FROM t2;
CHECK TABLE t2;
diff --git a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
index d99a55b9..83abb783 100644
--- a/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
+++ b/mysql-test/suite/encryption/t/innodb_encrypt_temporary_tables.test
@@ -2,10 +2,12 @@
--source include/have_innodb.inc
--source include/have_file_key_management_plugin.inc
-SELECT variable_value into @old_encrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) INTO @old_encrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
-SELECT variable_value into @old_decrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) INTO @old_decrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
CREATE TEMPORARY TABLE t1(f1 CHAR(200), f2 CHAR(200)) ENGINE=InnoDB;
@@ -17,8 +19,10 @@ INSERT INTO t2 (f1,f2,f3) SELECT '', '', '' FROM seq_1_to_8192;
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t2;
-SELECT variable_value > @old_encrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) > @old_encrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_encrypted';
-SELECT variable_value > @old_decrypted FROM information_schema.global_status
+SELECT CAST(variable_value AS INT) > @old_decrypted
+FROM information_schema.global_status
WHERE variable_name = 'innodb_encryption_n_temp_blocks_decrypted';
diff --git a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
index 22755571..5f02d966 100644
--- a/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
@@ -6,7 +6,6 @@
let MYSQLD_DATADIR = `SELECT @@datadir`;
--let SEARCH_RANGE = 10000000
---let $id = `SELECT RAND()`
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
@@ -30,19 +29,18 @@ end//
delimiter ;//
commit;
-set autocommit=0;
-call innodb_insert_proc(10000);
+begin;
+set statement unique_checks=0, foreign_key_checks=0 for
+call innodb_insert_proc(100);
commit;
-set autocommit=1;
+DROP PROCEDURE innodb_insert_proc;
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
--let $wait_timeout= 600
--let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0
--source include/wait_condition.inc
-# shutdown so that grep is safe
---source include/shutdown_mysqld.inc
-
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
--echo # tablespaces should be now encrypted
--let SEARCH_PATTERN=foobar
--echo # t1 yes on expecting NOT FOUND
@@ -57,11 +55,8 @@ set autocommit=1;
-- let SEARCH_FILE=$t3_IBD
-- source include/search_pattern_in_file.inc
---source include/start_mysqld.inc
let MYSQLD_DATADIR =`SELECT @@datadir`;
-
--list_files $MYSQLD_DATADIR/test
-FLUSH TABLES t1, t2, t3 FOR EXPORT;
perl;
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
ib_backup_tablespaces("test", "t1","t2","t3");
@@ -80,14 +75,13 @@ ib_restore_tablespaces("test", "t1","t2","t3");
EOF
ALTER TABLE t1 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t1;
+SELECT COUNT(*) FROM t1;
ALTER TABLE t2 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t2;
+SELECT COUNT(*) FROM t2;
ALTER TABLE t3 IMPORT TABLESPACE;
-SELECT COUNT(1) FROM t3;
+SELECT COUNT(*) FROM t3;
-# shutdown so that grep is safe
---source include/shutdown_mysqld.inc
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
--echo # tablespaces should remain encrypted after import
--let SEARCH_PATTERN=foobar
@@ -103,28 +97,18 @@ SELECT COUNT(1) FROM t3;
-- let SEARCH_FILE=$t3_IBD
-- source include/search_pattern_in_file.inc
---source include/start_mysqld.inc
-
-ALTER TABLE t1 ENGINE InnoDB;
+UNLOCK TABLES;
+ALTER TABLE t1 FORCE;
SHOW CREATE TABLE t1;
-ALTER TABLE t2 ENGINE InnoDB;
+ALTER TABLE t2 FORCE;
SHOW CREATE TABLE t2;
-ALTER TABLE t3 ENGINE InnoDB;
+ALTER TABLE t3 FORCE;
SHOW CREATE TABLE t3;
---echo # Restarting server
--- source include/restart_mysqld.inc
---echo # Done restarting server
-
--echo # Verify that tables are still usable
-SELECT COUNT(1) FROM t1;
-SELECT COUNT(1) FROM t2;
-SELECT COUNT(1) FROM t3;
-
-# shutdown so that grep is safe
---source include/shutdown_mysqld.inc
+CHECK TABLE t1, t2, t3 EXTENDED;
+FLUSH TABLES t1, t2, t3 FOR EXPORT;
---echo # Tablespaces should be encrypted after restart
--let SEARCH_PATTERN=foobar
--echo # t1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$t1_IBD
@@ -136,19 +120,7 @@ SELECT COUNT(1) FROM t3;
--echo # t3 ... on expecting NOT FOUND
--let SEARCH_PATTERN=barfoo
-- let SEARCH_FILE=$t3_IBD
--- source include/search_pattern_in_file.inc
-
---source include/start_mysqld.inc
-
---echo # Wait max 10 min for key encryption threads to encrypt all spaces
---let $wait_timeout= 600
---let $wait_condition=SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND ROTATING_OR_FLUSHING <> 0
---source include/wait_condition.inc
---echo # Success!
---echo # Restart mysqld --innodb_encrypt_tables=0 --innodb_encryption_threads=0
--- let $restart_parameters=--innodb_encrypt_tables=0 --innodb_encryption_threads=0
--- source include/restart_mysqld.inc
+UNLOCK TABLES;
-DROP PROCEDURE innodb_insert_proc;
DROP TABLE t1, t2, t3;