mirror of
https://github.com/MariaDB/server.git
synced 2025-07-20 10:24:14 +03:00
InnoDB always keeps all tablespaces in the fil_system cache. The fil_system.LRU is only for closing file handles; the fil_space_t and fil_node_t for all data files will remain in main memory. Between startup to shutdown, they can only be created and removed by DDL statements. Therefore, we can let dict_table_t::space point directly to the fil_space_t. dict_table_t::space_id: A numeric tablespace ID for the corner cases where we do not have a tablespace. The most prominent examples are ALTER TABLE...DISCARD TABLESPACE or a missing or corrupted file. There are a few functional differences; most notably: (1) DROP TABLE will delete matching .ibd and .cfg files, even if they were not attached to the data dictionary. (2) Some error messages will report file names instead of numeric IDs. There still are many functions that use numeric tablespace IDs instead of fil_space_t*, and many functions could be converted to fil_space_t member functions. Also, Tablespace and Datafile should be merged with fil_space_t and fil_node_t. page_id_t and buf_page_get_gen() could use fil_space_t& instead of a numeric ID, and after moving to a single buffer pool (MDEV-15058), buf_pool_t::page_hash could be moved to fil_space_t::page_hash. FilSpace: Remove. Only few calls to fil_space_acquire() will remain, and gradually they should be removed. mtr_t::set_named_space_id(ulint): Renamed from set_named_space(), to prevent accidental calls to this slower function. Very few callers remain. fseg_create(), fsp_reserve_free_extents(): Take fil_space_t* as a parameter instead of a space_id. fil_space_t::rename(): Wrapper for fil_rename_tablespace_check(), fil_name_write_rename(), fil_rename_tablespace(). Mariabackup passes the parameter log=false; InnoDB passes log=true. dict_mem_table_create(): Take fil_space_t* instead of space_id as parameter. dict_process_sys_tables_rec_and_mtr_commit(): Replace the parameter 'status' with 'bool cached'. dict_get_and_save_data_dir_path(): Avoid copying the fil_node_t::name. fil_ibd_open(): Return the tablespace. fil_space_t::set_imported(): Replaces fil_space_set_imported(). truncate_t: Change many member function parameters to fil_space_t*, and remove page_size parameters. row_truncate_prepare(): Merge to its only caller. row_drop_table_from_cache(): Assert that the table is persistent. dict_create_sys_indexes_tuple(): Write SYS_INDEXES.SPACE=FIL_NULL if the tablespace has been discarded. row_import_update_discarded_flag(): Remove a constant parameter.
42 lines
1.8 KiB
Plaintext
42 lines
1.8 KiB
Plaintext
--source include/have_innodb.inc
|
|
# embedded does not support restart
|
|
-- source include/not_embedded.inc
|
|
-- source filekeys_plugin_exists.inc
|
|
#
|
|
# MDEV-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys
|
|
# MDEV-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
|
|
#
|
|
|
|
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` (has an unreadable root page|is corrupted)");
|
|
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t1\\.ibd' cannot be decrypted\\.");
|
|
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
|
|
# Suppression for builds where file_key_management plugin is linked statically
|
|
call mtr.add_suppression("Couldn't load plugins from 'file_key_management");
|
|
|
|
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
|
--source include/restart_mysqld.inc
|
|
|
|
SET GLOBAL innodb_file_per_table = ON;
|
|
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB
|
|
ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
|
|
INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
|
|
|
|
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys3.txt
|
|
--source include/restart_mysqld.inc
|
|
|
|
--replace_regex /key_id [1-9][0-9]*/\1 /
|
|
OPTIMIZE TABLE t1;
|
|
--replace_regex /key_id [1-9][0-9]*/\1 /
|
|
SHOW WARNINGS;
|
|
|
|
--replace_regex /key_id [1-9][0-9]*/\1 /
|
|
CHECK TABLE t1;
|
|
--replace_regex /key_id [1-9][0-9]*/\1 /
|
|
SHOW WARNINGS;
|
|
|
|
--let $restart_parameters=--plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
|
--source include/restart_mysqld.inc
|
|
|
|
DROP TABLE t1;
|