mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-16416 Crash on IMPORT TABLESPACE of a ROW_FORMAT=COMPRESSED table
fil_iterate(): Invoke fil_encrypt_buf() correctly when a ROW_FORMAT=COMPRESSED table with a physical page size of innodb_page_size is being imported. Also, validate the page checksum before decryption, and reduce the scope of some variables. AbstractCallback::operator()(): Remove the parameter 'offset'. The check for it in FetchIndexRootPages::operator() was basically redundant and dead code since the previous refactoring.
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
|
||||
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
|
||||
SET @innodb_file_format_orig = @@GLOBAL.innodb_file_format;
|
||||
SET @innodb_file_per_table_orig = @@GLOBAL.innodb_file_per_table;
|
||||
SET @innodb_compression_algo = @@GLOBAL.innodb_compression_algorithm;
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_compression_algorithm = 1;
|
||||
@ -134,3 +137,6 @@ NOT FOUND /tmpres/ in t3.ibd
|
||||
NOT FOUND /mysql/ in t4.ibd
|
||||
DROP PROCEDURE innodb_insert_proc;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
|
||||
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
|
||||
SET GLOBAL innodb_compression_algorithm = @innodb_compression_algo;
|
||||
|
@ -1,10 +1,6 @@
|
||||
-- source include/have_innodb.inc
|
||||
-- source include/innodb_page_size_small.inc
|
||||
-- source include/have_file_key_management_plugin.inc
|
||||
# embedded does not support restart
|
||||
-- source include/not_embedded.inc
|
||||
-- source include/not_valgrind.inc
|
||||
# Avoid CrashReporter popup on Mac
|
||||
-- source include/not_crashrep.inc
|
||||
|
||||
#
|
||||
# MDEV-8770: Incorrect error message when importing page compressed tablespace
|
||||
@ -13,17 +9,13 @@
|
||||
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
|
||||
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");
|
||||
|
||||
--disable_query_log
|
||||
let $innodb_file_format_orig = `SELECT @@innodb_file_format`;
|
||||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`;
|
||||
let $innodb_compression_algo = `SELECT @@innodb_compression_algorithm`;
|
||||
--enable_query_log
|
||||
SET @innodb_file_format_orig = @@GLOBAL.innodb_file_format;
|
||||
SET @innodb_file_per_table_orig = @@GLOBAL.innodb_file_per_table;
|
||||
SET @innodb_compression_algo = @@GLOBAL.innodb_compression_algorithm;
|
||||
|
||||
--disable_warnings
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_compression_algorithm = 1;
|
||||
--enable_warnings
|
||||
|
||||
--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
|
||||
--let $MYSQLD_DATADIR = `SELECT @@datadir`
|
||||
@ -37,7 +29,9 @@ create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes en
|
||||
show warnings;
|
||||
create table t2(c1 bigint not null, b char(200)) engine=innodb page_compressed=1 encrypted=yes encryption_key_id=4;
|
||||
show warnings;
|
||||
create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4;
|
||||
let $kbs= `select floor(@@global.innodb_page_size/1024)`;
|
||||
--replace_regex / key_block_size=\d+//i
|
||||
eval create table t3(c1 bigint not null, b char(200)) engine=innodb row_format=compressed encrypted=yes encryption_key_id=4 key_block_size=$kbs;
|
||||
show warnings;
|
||||
create table t4(c1 bigint not null, b char(200)) engine=innodb page_compressed=1;
|
||||
show warnings;
|
||||
@ -98,6 +92,7 @@ ALTER TABLE t2 IMPORT TABLESPACE;
|
||||
SHOW CREATE TABLE t2;
|
||||
SELECT COUNT(*) FROM t2;
|
||||
ALTER TABLE t3 IMPORT TABLESPACE;
|
||||
--replace_regex / key_block_size=\d+//i
|
||||
SHOW CREATE TABLE t3;
|
||||
SELECT COUNT(*) FROM t3;
|
||||
ALTER TABLE t4 IMPORT TABLESPACE;
|
||||
@ -125,11 +120,6 @@ SELECT COUNT(*) FROM t4;
|
||||
DROP PROCEDURE innodb_insert_proc;
|
||||
DROP TABLE t1,t2,t3,t4;
|
||||
|
||||
# reset system
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;
|
||||
EVAL SET GLOBAL innodb_file_format = $innodb_file_format_orig;
|
||||
EVAL SET GLOBAL innodb_compression_algorithm = $innodb_compression_algo;
|
||||
--enable_query_log
|
||||
--enable_warnings
|
||||
SET GLOBAL innodb_file_format = @innodb_file_format_orig;
|
||||
SET GLOBAL innodb_file_per_table = @innodb_file_per_table_orig;
|
||||
SET GLOBAL innodb_compression_algorithm = @innodb_compression_algo;
|
||||
|
Reference in New Issue
Block a user