mirror of
https://github.com/MariaDB/server.git
synced 2025-08-27 13:04:36 +03:00
Before commit6112853cda
in MySQL 4.1.1 introduced the parameter innodb_file_per_table, all InnoDB data was written to the InnoDB system tablespace (often named ibdata1). A serious design problem is that once the system tablespace has grown to some size, it cannot shrink even if the data inside it has been deleted. There are also other design problems, such as the server hang MDEV-29930 that should only be possible when using innodb_file_per_table=0 and innodb_undo_tablespaces=0 (storing both tables and undo logs in the InnoDB system tablespace). The parameter innodb_change_buffering was deprecated in commitb5852ffbee
. Starting with commitbaf276e6d4
(MDEV-19229) the number of innodb_undo_tablespaces can be increased, so that the undo logs can be moved out of the system tablespace of an existing installation. If all these things (tables, undo logs, and the change buffer) are removed from the InnoDB system tablespace, the only variable-size data structure inside it is the InnoDB data dictionary. DDL operations on .ibd files was optimized in commit86dc7b4d4c
(MDEV-24626). That should have removed any thinkable performance advantage of using innodb_file_per_table=0. Since there should be no benefit of setting innodb_file_per_table=0, the parameter should be deprecated. Starting with MySQL 5.6 and MariaDB Server 10.0, the default value is innodb_file_per_table=1.
127 lines
4.4 KiB
Plaintext
127 lines
4.4 KiB
Plaintext
-- source include/have_innodb.inc
|
|
-- source include/innodb_undo_tablespaces.inc
|
|
-- source include/have_file_key_management_plugin.inc
|
|
|
|
#
|
|
# MDEV-8138: strange results from encrypt-and-grep test
|
|
#
|
|
--let $MYSQLD_DATADIR=`select @@datadir`
|
|
--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
|
|
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
|
|
--let t2_IBD = $MYSQLD_DATADIR/test/t2.ibd
|
|
--let t3_IBD = $MYSQLD_DATADIR/test/t3.ibd
|
|
--let SEARCH_RANGE = 10000000
|
|
|
|
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
|
|
create table t2 (a varchar(255)) engine=innodb;
|
|
show warnings;
|
|
create table t3 (a varchar(255)) engine=innodb encrypted=no;
|
|
|
|
insert t1 values (repeat('foobarsecret', 12));
|
|
insert t2 values (repeat('tempsecret', 12));
|
|
insert t3 values (repeat('dummysecret', 12));
|
|
|
|
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
|
|
--let $wait_timeout= 600
|
|
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0
|
|
--source include/wait_condition.inc
|
|
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
|
|
FLUSH TABLES t1,t2,t3 FOR EXPORT;
|
|
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # t1 yes on expecting NOT FOUND
|
|
-- let SEARCH_FILE=$t1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=tempsecret
|
|
--echo # t2 ... on expecting NOT FOUND
|
|
-- let SEARCH_FILE=$t2_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=dummysecret
|
|
--echo # t3 no on expecting FOUND
|
|
-- let SEARCH_FILE=$t3_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # ibdata1 expecting NOT FOUND
|
|
-- let SEARCH_FILE=$ib1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
|
|
UNLOCK TABLES;
|
|
|
|
--echo # Now turn off encryption and wait for threads to decrypt everything
|
|
|
|
SET GLOBAL innodb_encrypt_tables = off;
|
|
|
|
--echo # Wait max 10 min for key encryption threads to decrypt all spaces
|
|
--let $wait_timeout= 600
|
|
--let $tables_count= `select count(*) + @@global.innodb_undo_tablespaces from information_schema.tables where engine = 'InnoDB'`
|
|
|
|
--let $wait_condition=SELECT COUNT(*) = $tables_count FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0 AND CURRENT_KEY_VERSION = 0;
|
|
--source include/wait_condition.inc
|
|
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
|
|
FLUSH TABLES t1,t2,t3 FOR EXPORT;
|
|
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # t1 yes on expecting NOT FOUND
|
|
-- let SEARCH_FILE=$t1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=tempsecret
|
|
--echo # t2 ... default expecting FOUND
|
|
-- let SEARCH_FILE=$t2_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=dummysecret
|
|
--echo # t3 no on expecting FOUND
|
|
-- let SEARCH_FILE=$t3_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # ibdata1 expecting NOT FOUND
|
|
-- let SEARCH_FILE=$ib1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
|
|
UNLOCK TABLES;
|
|
|
|
--echo # Now turn on encryption and wait for threads to encrypt all spaces
|
|
SET GLOBAL innodb_encrypt_tables = on;
|
|
|
|
--echo # Wait max 10 min for key encryption threads to encrypt all spaces
|
|
--let $wait_timeout= 600
|
|
--let $wait_condition=SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
--source include/wait_condition.inc
|
|
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
|
|
--sorted_result
|
|
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
|
|
|
|
FLUSH TABLES t1,t2,t3 FOR EXPORT;
|
|
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # t1 yes on expecting NOT FOUND
|
|
-- let SEARCH_FILE=$t1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=tempsecret
|
|
--echo # t2 ... on expecting NOT FOUND
|
|
-- let SEARCH_FILE=$t2_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=dummysecret
|
|
--echo # t3 no on expecting FOUND
|
|
-- let SEARCH_FILE=$t3_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
--let SEARCH_PATTERN=foobarsecret
|
|
--echo # ibdata1 expecting NOT FOUND
|
|
-- let SEARCH_FILE=$ib1_IBD
|
|
-- source include/search_pattern_in_file.inc
|
|
|
|
UNLOCK TABLES;
|
|
|
|
drop table t1, t2, t3;
|