summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-08-19 12:25:00 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-08-19 12:25:00 +0300
commitf3fcf5f45c9c09242bfb8762a88c26238458e4c2 (patch)
tree914f1a5d9bd38b9f9d09d0c39306c80c00e21842 /mysql-test/suite/encryption
parent475f69b98587c2a0842e3fcbfe515e4362ded973 (diff)
parent17980e35fafdf0b05c89c11ecafbea96e1cfc5e5 (diff)
downloadmariadb-git-f3fcf5f45c9c09242bfb8762a88c26238458e4c2.tar.gz
Merge 10.5 to 10.6
Diffstat (limited to 'mysql-test/suite/encryption')
-rw-r--r--mysql-test/suite/encryption/r/innodb_import.result21
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.combinations7
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.opt1
-rw-r--r--mysql-test/suite/encryption/t/innodb_import.test23
4 files changed, 52 insertions, 0 deletions
diff --git a/mysql-test/suite/encryption/r/innodb_import.result b/mysql-test/suite/encryption/r/innodb_import.result
new file mode 100644
index 00000000000..169af37f404
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_import.result
@@ -0,0 +1,21 @@
+#
+# MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace
+#
+CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "InnoDB");
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD KEY idx (f2(13));
+ALTER TABLE t2 DISCARD TABLESPACE;
+FLUSH TABLES t1 FOR EXPORT;
+UNLOCK TABLES;
+ALTER TABLE t2 IMPORT TABLESPACE;
+ERROR HY000: Internal error: Drop all secondary indexes before importing table test/t2 when .cfg file is missing.
+ALTER TABLE t2 DROP KEY idx;
+ALTER TABLE t2 IMPORT TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table `t2`
+Warning 1810 IO Read error: (2, No such file or directory) Error opening './test/t2.cfg', will attempt to import without schema verification
+SELECT * FROM t2;
+f1 f2
+1 InnoDB
+DROP TABLE t1, t2;
diff --git a/mysql-test/suite/encryption/t/innodb_import.combinations b/mysql-test/suite/encryption/t/innodb_import.combinations
new file mode 100644
index 00000000000..75458949582
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_import.combinations
@@ -0,0 +1,7 @@
+[page_compressed]
+innodb-compression-default=1
+[encryption]
+innodb-encrypt-tables=1
+[page_compressed_encryption]
+innodb-compression-default=1
+innodb-encrypt-tables=1
diff --git a/mysql-test/suite/encryption/t/innodb_import.opt b/mysql-test/suite/encryption/t/innodb_import.opt
new file mode 100644
index 00000000000..c44c611ed60
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_import.opt
@@ -0,0 +1 @@
+--innodb-checksum-algorithm=crc32
diff --git a/mysql-test/suite/encryption/t/innodb_import.test b/mysql-test/suite/encryption/t/innodb_import.test
new file mode 100644
index 00000000000..2e5470c5568
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_import.test
@@ -0,0 +1,23 @@
+--source include/have_innodb.inc
+--source include/have_example_key_management_plugin.inc
+--source include/innodb_checksum_algorithm.inc
+--echo #
+--echo # MDEV-26131 SEGV in ha_innobase::discard_or_import_tablespace
+--echo #
+let $MYSQLD_DATADIR = `SELECT @@datadir`;
+CREATE TABLE t1(f1 int,f2 text)ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1, "InnoDB");
+CREATE TABLE t2 LIKE t1;
+ALTER TABLE t2 ADD KEY idx (f2(13));
+ALTER TABLE t2 DISCARD TABLESPACE;
+FLUSH TABLES t1 FOR EXPORT;
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_DATADIR/test/t2.ibd
+UNLOCK TABLES;
+--error ER_INTERNAL_ERROR
+ALTER TABLE t2 IMPORT TABLESPACE;
+
+ALTER TABLE t2 DROP KEY idx;
+--replace_regex /opening '.*\/test\//opening '.\/test\//
+ALTER TABLE t2 IMPORT TABLESPACE;
+SELECT * FROM t2;
+DROP TABLE t1, t2;