mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge branch '11.2' into 11.4
This commit is contained in:
@ -68,4 +68,19 @@ ALTER TABLE t1 ALGORITHM=COPY, FORCE;
|
||||
ALTER TABLE t2 ALGORITHM=COPY, FORCE;
|
||||
--disable_info
|
||||
DROP TABLE t2, t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35237 Bulk insert fails to apply buffered
|
||||
--echo # operation during copy alter
|
||||
--echo #
|
||||
CREATE TABLE t1 (f1 int NOT NULL, f2 tinyint(1) NOT NULL,
|
||||
f3 varchar(80) NOT NULL, PRIMARY KEY(f1),
|
||||
KEY(f2), KEY(f3))ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1,1,''),(2,0,''), (4,1,'e');
|
||||
CREATE TABLE t2 (f1 int NOT NULL, f2 int NOT NULL,KEY(f1))ENGINE=InnoDB;
|
||||
INSERT INTO t2 VALUES (1,0),(1,0);
|
||||
CREATE TABLE t engine=innodb
|
||||
SELECT t2.f2 FROM t2 JOIN t1 ON t1.f1 = t2.f1 AND t1.f3 = '' AND t1.f2=1 ;
|
||||
SELECT COUNT(*) FROM t;
|
||||
DROP TABLE t1, t2, t;
|
||||
SET GLOBAL innodb_stats_persistent=@default_stats_persistent;
|
||||
|
@ -4,15 +4,18 @@
|
||||
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
||||
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
|
||||
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
|
||||
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted.");
|
||||
call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) corrupted page .*, page number=3\\]");
|
||||
call mtr.add_suppression("Table `test`.`t1` is corrupted. Please drop the table and recreate.");
|
||||
call mtr.add_suppression("InnoDB: Unable to apply log to corrupted page 3 in file .*test.t1\\.ibd");
|
||||
call mtr.add_suppression("Table `test`.`t1` is corrupted. Please drop the table and recreate\\.");
|
||||
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
|
||||
call mtr.add_suppression("InnoDB: A long wait .* was observed for dict_sys");
|
||||
call mtr.add_suppression("InnoDB: Page \\[page id: space=[1-9][0-9]*, page number=3\\] log sequence number 1311768467463790320 is in the future!");
|
||||
call mtr.add_suppression("InnoDB: Your database may be corrupt");
|
||||
call mtr.add_suppression("InnoDB: MySQL-8\\.0 tablespace in .*test/t2\\.ibd");
|
||||
call mtr.add_suppression("InnoDB: Restart in MySQL for migration/recovery\\.");
|
||||
--enable_query_log
|
||||
|
||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||
let ALGO=`select @@innodb_checksum_algorithm`;
|
||||
CREATE TABLE t1(a BIGINT PRIMARY KEY) ENGINE=InnoDB;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
# Force a redo log checkpoint.
|
||||
@ -30,15 +33,32 @@ INSERT INTO t2 VALUES(1);
|
||||
--echo # Corrupt the pages
|
||||
|
||||
perl;
|
||||
do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
|
||||
my $polynomial = 0x82f63b78; # CRC-32C
|
||||
my $algo = $ENV{ALGO};
|
||||
my $ps = $ENV{INNODB_PAGE_SIZE};
|
||||
|
||||
my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
|
||||
open(FILE, "+<$file") || die "Unable to open $file";
|
||||
binmode FILE;
|
||||
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
|
||||
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
|
||||
# Replace the a=1 with a=0.
|
||||
$page =~ s/\x80\x0\x0\x0\x0\x0\x0\x1/\x80\x0\x0\x0\x0\x0\x0\x0/;
|
||||
# Assign a future FIL_PAGE_LSN
|
||||
substr($page, 16, 8) = pack("NN", 0x12345678, 0x9abcdef0);
|
||||
substr($page, $ps - 8, 8) = pack("NN", 0x9abcdef0, 0x9abcdef0);
|
||||
if ($algo =~ /full_crc32/)
|
||||
{
|
||||
my $ck = mycrc32(substr($page, 0, $ps - 4), 0, $polynomial);
|
||||
substr($page, $ps - 4, 4) = pack("N", $ck);
|
||||
}
|
||||
else
|
||||
{
|
||||
# Replace the innodb_checksum_algorithm=crc32 checksum
|
||||
my $ck= pack("N",
|
||||
mycrc32(substr($page, 4, 22), 0, $polynomial) ^
|
||||
mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial));
|
||||
substr ($page, 0, 4) = $ck;
|
||||
substr ($page, $ps - 8, 4) = $ck;
|
||||
}
|
||||
sysseek(FILE, 3*$ps, 0) || die "Unable to seek $file\n";
|
||||
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
|
||||
close FILE or die "close";
|
||||
@ -46,20 +66,23 @@ close FILE or die "close";
|
||||
$file = "$ENV{MYSQLD_DATADIR}/test/t2.ibd";
|
||||
open(FILE, "+<$file") || die "Unable to open $file";
|
||||
binmode FILE;
|
||||
# Corrupt pages 1 to 3. MLOG_INIT_FILE_PAGE2 should protect us!
|
||||
# Unfortunately, we are not immune to page 0 corruption.
|
||||
seek (FILE, $ps, SEEK_SET) or die "seek";
|
||||
print FILE chr(0xff) x ($ps * 3);
|
||||
# Corrupt pages 0 to 3. INIT_PAGE should protect us!
|
||||
print FILE chr(0xff) x ($ps * 4);
|
||||
close FILE or die "close";
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
--error ER_UNKNOWN_STORAGE_ENGINE
|
||||
SELECT * FROM t1;
|
||||
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
let SEARCH_PATTERN=InnoDB: Page \\[page id: space=[1-9][0-9]*, page number=3\\] log sequence number 1311768467463790320 is in the future!;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
let $restart_parameters=--innodb_force_recovery=1;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--error ER_NO_SUCH_TABLE_IN_ENGINE,ER_TABLE_CORRUPT
|
||||
--error 0,ER_NO_SUCH_TABLE_IN_ENGINE
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
CHECK TABLE t2;
|
||||
@ -81,13 +104,36 @@ DELETE FROM t1 WHERE pk=3;
|
||||
--source ../include/no_checkpoint_end.inc
|
||||
disconnect con1;
|
||||
|
||||
--echo # Corrupt the pages
|
||||
--echo # Corrupt the page
|
||||
perl;
|
||||
do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
|
||||
my $polynomial = 0x82f63b78; # CRC-32C
|
||||
my $algo = $ENV{ALGO};
|
||||
my $ps = $ENV{INNODB_PAGE_SIZE};
|
||||
my $file = "$ENV{MYSQLD_DATADIR}/test/t1.ibd";
|
||||
open(FILE, "+<$file") || die "Unable to open $file";
|
||||
binmode FILE;
|
||||
seek (FILE, $ENV{INNODB_PAGE_SIZE} * 3, SEEK_SET) or die "seek";
|
||||
print FILE "junk";
|
||||
sysseek(FILE, $ps * 3, SEEK_SET) or die "seek";
|
||||
sysread(FILE, $page, $ps)==$ps||die "Unable to read $file\n";
|
||||
# Set FIL_PAGE_LSN to the maximum
|
||||
substr($page, 16, 8) = chr(255) x 8;
|
||||
substr($page, $ps - 8, 8) = chr(255) x 8;
|
||||
if ($algo =~ /full_crc32/)
|
||||
{
|
||||
my $ck = mycrc32(substr($page, 0, $ps - 4), 0, $polynomial);
|
||||
substr($page, $ps - 4, 4) = pack("N", $ck);
|
||||
}
|
||||
else
|
||||
{
|
||||
# Replace the innodb_checksum_algorithm=crc32 checksum
|
||||
my $ck= pack("N",
|
||||
mycrc32(substr($page, 4, 22), 0, $polynomial) ^
|
||||
mycrc32(substr($page_, 38, $ps - 38 - 8), 0, $polynomial));
|
||||
substr ($page, 0, 4) = $ck;
|
||||
substr ($page, $ps - 8, 4) = $ck;
|
||||
}
|
||||
sysseek(FILE, $ps * 3, SEEK_SET) or die "seek";
|
||||
syswrite(FILE, $page);
|
||||
close FILE or die "close";
|
||||
EOF
|
||||
--source include/start_mysqld.inc
|
||||
|
16
mysql-test/suite/innodb/t/create_like.test
Normal file
16
mysql-test/suite/innodb/t/create_like.test
Normal file
@ -0,0 +1,16 @@
|
||||
--source include/have_innodb.inc
|
||||
--echo #
|
||||
--echo # MDEV-35144 CREATE TABLE ... LIKE uses current innodb_compression_default instead of the create value
|
||||
--echo #
|
||||
|
||||
set innodb_compression_default= off;
|
||||
create table t1 (a int, b blob) engine=innodb;
|
||||
set innodb_compression_default= on;
|
||||
create table s_import like t1;
|
||||
|
||||
show create table t1;
|
||||
show create table s_import;
|
||||
|
||||
DROP TABLE t1,s_import;
|
||||
|
||||
--echo # End of 10.5 tests
|
@ -26,3 +26,16 @@ reap;
|
||||
CREATE TABLE t1 (a SERIAL) ENGINE=InnoDB;
|
||||
DROP TABLE t1;
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35236 Assertion `(mem_root->flags & 4) == 0' failed in safe_lexcstrdup_root
|
||||
--echo #
|
||||
prepare stmt from 'create or replace table t engine=innodb select 1 as f';
|
||||
set innodb_compression_default=on;
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
drop table t;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
@ -18,6 +18,9 @@ call mtr.add_suppression("InnoDB: Checksum mismatch in datafile: ");
|
||||
call mtr.add_suppression("InnoDB: Inconsistent tablespace ID in .*t1\\.ibd");
|
||||
call mtr.add_suppression("\\[Warning\\] Found 1 prepared XA transactions");
|
||||
call mtr.add_suppression("InnoDB: Header page consists of zero bytes in datafile:");
|
||||
call mtr.add_suppression("InnoDB: Page \\[page id: space=[1-9][0-9]*, page number=3\\] log sequence number 18446744073709551615 is in the future!");
|
||||
call mtr.add_suppression("InnoDB: Your database may be corrupt or you may have copied the InnoDB tablespace but not the ib_logfile0");
|
||||
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
||||
--enable_query_log
|
||||
|
||||
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
|
||||
@ -71,7 +74,26 @@ syswrite(FILE, chr(0) x ($page_size/2));
|
||||
sysseek(FILE, 3*$page_size, 0);
|
||||
sysread(FILE, $page, $page_size)==$page_size||die "Unable to read $name\n";
|
||||
sysseek(FILE, 3*$page_size, 0)||die "Unable to seek $fname\n";
|
||||
syswrite(FILE, chr(0) x ($page_size/2));
|
||||
my $corrupted = $page;
|
||||
# Set FIL_PAGE_LSN to the maximum
|
||||
substr($corrupted, 16, 8) = chr(255) x 8;
|
||||
substr($corrupted, $page_size - 8, 8) = chr(255) x 8;
|
||||
if ($algo =~ /full_crc32/)
|
||||
{
|
||||
my $ck = mycrc32(substr($corrupted, 0, $page_size - 4), 0, $polynomial);
|
||||
substr($corrupted, $page_size - 4, 4) = pack("N", $ck);
|
||||
}
|
||||
else
|
||||
{
|
||||
# Replace the innodb_checksum_algorithm=crc32 checksum
|
||||
my $ck= pack("N",
|
||||
mycrc32(substr($corrupted, 4, 22), 0, $polynomial) ^
|
||||
mycrc32(substr($corrupted_, 38, $page_size - 38 - 8), 0,
|
||||
$polynomial));
|
||||
substr ($corrupted, 0, 4) = $ck;
|
||||
substr ($corrupted, $page_size - 8, 4) = $ck;
|
||||
}
|
||||
syswrite(FILE, $corrupted);
|
||||
close FILE;
|
||||
|
||||
# Change the flag offset of page 0 in doublewrite buffer
|
||||
@ -113,10 +135,28 @@ die "Did not find the page in the doublewrite buffer ($d1,$d2)\n";
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=[1-9][0-9]*, page number=0\] of datafile;
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=[1-9][0-9]*, page number=0\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=3\];
|
||||
let SEARCH_PATTERN=InnoDB: The log was only scanned up to \\d+, while the current LSN at the time of the latest checkpoint \\d+ was 0 and the maximum LSN on a data page was 18446744073709551615!
|
||||
--source include/search_pattern_in_file.inc
|
||||
--error ER_XAER_NOTA
|
||||
XA ROLLBACK 'x';
|
||||
let $shutdown_timeout=0;
|
||||
--source include/shutdown_mysqld.inc
|
||||
let $shutdown_timeout=;
|
||||
# Corrupt the file in a better way.
|
||||
perl;
|
||||
use IO::Handle;
|
||||
my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
|
||||
my $page_size = $ENV{INNODB_PAGE_SIZE};
|
||||
open(FILE, "+<", $fname) or die;
|
||||
sysseek(FILE, ($page_size/2), 0);
|
||||
syswrite(FILE, chr(0) x ($page_size/2));
|
||||
sysseek(FILE, 3*$page_size, 0);
|
||||
syswrite(FILE, chr(0) x ($page_size/2));
|
||||
close FILE;
|
||||
EOF
|
||||
--source include/start_mysqld.inc
|
||||
XA ROLLBACK 'x';
|
||||
check table t1;
|
||||
select f1, f2 from t1;
|
||||
@ -144,7 +184,7 @@ close FILE;
|
||||
EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=[1-9][0-9]*, page number=0\] of datafile;
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=[1-9][0-9]*, page number=[03]\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
XA ROLLBACK 'x';
|
||||
check table t1;
|
||||
|
@ -81,10 +81,10 @@ EOF
|
||||
let $restart_parameters=;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile;
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=0, page number=0\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \[page id: space=0, page number=1\];
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=0, page number=1\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
check table t1;
|
||||
@ -129,10 +129,10 @@ EOF
|
||||
let $restart_parameters=;
|
||||
--source include/start_mysqld.inc
|
||||
|
||||
let SEARCH_PATTERN=InnoDB: Restoring page \[page id: space=0, page number=0\] of datafile;
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=0, page number=0\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \[page id: space=0, page number=1\];
|
||||
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=0, page number=1\\];
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
check table t1;
|
||||
|
@ -29,8 +29,8 @@ call mtr.add_suppression("InnoDB: Page for tablespace ");
|
||||
call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=");
|
||||
call mtr.add_suppression("InnoDB: Unknown index id .* on page");
|
||||
call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing");
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*ibdata1' page");
|
||||
call mtr.add_suppression("InnoDB: File '.*ibdata1' is corrupted");
|
||||
call mtr.add_suppression("InnoDB: Failed to read page \\d+ from file '.*test/t1\\.ibd'");
|
||||
call mtr.add_suppression("InnoDB: File '.*(ibdata1|t1\\.ibd)' is corrupted");
|
||||
FLUSH TABLES;
|
||||
|
||||
let MYSQLD_DATADIR =`SELECT @@datadir`;
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Table `test`\\.`t1` is corrupted\\. Please drop the table and recreate\\.");
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
|
||||
call mtr.add_suppression("InnoDB: Failed to read page [1-9][0-9]* from file '.*test.t1\\.ibd'");
|
||||
call mtr.add_suppression("InnoDB: We detected index corruption in an InnoDB type table");
|
||||
call mtr.add_suppression("Index for table 't1' is corrupt; try to repair it");
|
||||
call mtr.add_suppression("InnoDB: File '.*test/t1\\.ibd' is corrupted");
|
||||
|
@ -567,6 +567,16 @@ ALTER TABLE t1 DROP COLUMN a;
|
||||
ALTER TABLE t1 DROP COLUMN c;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-35122 Incorrect NULL value handling for instantly
|
||||
--echo # dropped BLOB columns
|
||||
--echo #
|
||||
CREATE TABLE t1 (c1 INT, c2 BLOB, c3 BLOB NOT NULL) ROW_FORMAT=REDUNDANT,ENGINE=InnoDB;
|
||||
ALTER TABLE t1 DROP c2;
|
||||
ALTER TABLE t1 DROP c3;
|
||||
INSERT INTO t1 VALUES(1);
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.5 tests
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
@ -2,9 +2,8 @@
|
||||
--source include/have_debug.inc
|
||||
|
||||
--disable_query_log
|
||||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*test.t1\\.ibd' page");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Failed to read page 19 from file '.*test.t1\\.ibd': Page read from tablespace is corrupted\\.");
|
||||
call mtr.add_suppression("InnoDB: (Unable to apply log to|Discarding log for) corrupted page .*, page number=19\\]");
|
||||
call mtr.add_suppression("InnoDB: Unable to apply log to corrupted page 19 in file .*t1\\.ibd");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: Plugin initialization aborted at srv0start\\.cc.* with error Data structure corruption");
|
||||
call mtr.add_suppression("\\[ERROR\\] Plugin 'InnoDB' (init function|registration)");
|
||||
call mtr.add_suppression("\\[ERROR\\] InnoDB: We detected index corruption");
|
||||
|
@ -152,10 +152,12 @@ BEGIN; INSERT INTO t SET a=2;
|
||||
|
||||
--connection consistent
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
SAVEPOINT sp1;
|
||||
--disable_ps2_protocol
|
||||
--error ER_CHECKREAD
|
||||
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
|
||||
--enable_ps2_protocol
|
||||
SAVEPOINT sp1;
|
||||
|
||||
--connection con_weird
|
||||
START TRANSACTION WITH CONSISTENT SNAPSHOT;
|
||||
@ -181,3 +183,5 @@ SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
|
||||
|
||||
--connection default
|
||||
DROP TABLE t;
|
||||
|
||||
--echo # End of 10.6 tests
|
||||
|
@ -92,6 +92,7 @@ let SEARCH_PATTERN= InnoDB: Set innodb_force_recovery=1 to ignore this and to pe
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--let $on_linux= `select @@version_compile_os LIKE 'Linux%'`
|
||||
--source include/shutdown_mysqld.inc
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
|
||||
@ -105,9 +106,18 @@ let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
|
||||
--source include/start_mysqld.inc
|
||||
eval $check_no_innodb;
|
||||
--source include/shutdown_mysqld.inc
|
||||
# On Windows, this error message is not output when t2.ibd is a directory!
|
||||
#let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*t2.ibd;
|
||||
#--source include/search_pattern_in_file.inc
|
||||
|
||||
--let SEARCH_PATTERN= InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\\.ibd'
|
||||
if (!$on_linux)
|
||||
{
|
||||
# os_file_get_size() would succeed on a directory.
|
||||
--echo FOUND 1 /$SEARCH_PATTERN/ in mysqld.1.err
|
||||
}
|
||||
if ($on_linux)
|
||||
{
|
||||
# lseek() reports EINVAL when invoked on a directory.
|
||||
--source include/search_pattern_in_file.inc
|
||||
}
|
||||
|
||||
--rmdir $MYSQLD_DATADIR/test/t2.ibd
|
||||
|
||||
@ -150,6 +160,7 @@ call mtr.add_suppression("InnoDB: Error number \\d+ means");
|
||||
call mtr.add_suppression("InnoDB: Cannot create file '.*t0.ibd'");
|
||||
call mtr.add_suppression("InnoDB: The file '.*t0\.ibd' already exists");
|
||||
call mtr.add_suppression("InnoDB: Cannot open datafile for read-write: '.*t2\.ibd'");
|
||||
call mtr.add_suppression("InnoDB: Could not measure the size of single-table tablespace file '.*test/t2\\.ibd'");
|
||||
# The following are for aborted startup without --innodb-force-recovery:
|
||||
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*test");
|
||||
call mtr.add_suppression("InnoDB: Cannot read first page of '.*test.[tu]2.ibd': I/O error");
|
||||
|
@ -1,5 +1,5 @@
|
||||
--source include/have_debug.inc
|
||||
--source include/linux.inc
|
||||
--source include/have_cgroupv2.inc
|
||||
--source include/not_embedded.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
@ -33,12 +33,21 @@ WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
|
||||
set debug_dbug="d,trigger_garbage_collection";
|
||||
SET GLOBAL innodb_buffer_pool_size=@@innodb_buffer_pool_size;
|
||||
|
||||
SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
|
||||
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
# either a fail or the pressure event
|
||||
let SEARCH_PATTERN= [Mm]emory pressure.*;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
# The garbage collection happens asynchronously after trigger, in a background
|
||||
# thread. So wait for it to happen to avoid sporadic failure.
|
||||
let $wait_condition=
|
||||
SELECT CAST(VARIABLE_VALUE AS INTEGER) < @dirty_prev AS LESS_DIRTY_IS_GOOD
|
||||
FROM INFORMATION_SCHEMA.GLOBAL_STATUS
|
||||
WHERE VARIABLE_NAME='Innodb_buffer_pool_pages_dirty';
|
||||
--source include/wait_condition.inc
|
||||
eval $wait_condition;
|
||||
let SEARCH_PATTERN= InnoDB: Memory pressure event freed.*;
|
||||
let SEARCH_WAIT= FOUND;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
set debug_dbug=@save_dbug;
|
||||
|
1
mysql-test/suite/innodb/t/page_compression_windows.opt
Normal file
1
mysql-test/suite/innodb/t/page_compression_windows.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb-sys-tablespaces
|
7
mysql-test/suite/innodb/t/page_compression_windows.test
Normal file
7
mysql-test/suite/innodb/t/page_compression_windows.test
Normal file
@ -0,0 +1,7 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/windows.inc
|
||||
create table t_compressed(b longblob) engine=InnoDB page_compressed=1;
|
||||
insert into t_compressed values(repeat(1,1000000));
|
||||
# Check that compression worked, i.e allocated size (physical file size) < logical file size
|
||||
select allocated_size < file_size from information_schema.innodb_sys_tablespaces where name='test/t_compressed';
|
||||
drop table t_compressed;
|
@ -66,5 +66,6 @@ let $restart_parameters=--innodb-force-recovery=1;
|
||||
--source include/wait_all_purged.inc
|
||||
drop table t1;
|
||||
call mtr.add_suppression("InnoDB: Failed to read page 3 from file '.*test/t1\\.ibd': Page read from tablespace is corrupted\\.");
|
||||
call mtr.add_suppression("InnoDB: File '.*t1\\.ibd' is corrupted");
|
||||
let $restart_parameters=;
|
||||
--source include/restart_mysqld.inc
|
||||
|
@ -6,6 +6,7 @@
|
||||
# Flush any open myisam tables from previous tests
|
||||
FLUSH TABLES;
|
||||
call mtr.add_suppression("Found 1 prepared XA transactions");
|
||||
call mtr.add_suppression("InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0 or XA PREPARE transactions exist");
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-13797 InnoDB may hang if shutdown is initiated soon after startup
|
||||
|
@ -23,6 +23,18 @@ DROP TABLE t1;
|
||||
--source include/wait_all_purged.inc
|
||||
SELECT NAME, FILE_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES WHERE SPACE = 0;
|
||||
|
||||
# Corruption during traversal of extent
|
||||
let $restart_parameters=--debug_dbug=+d,traversal_extent_fail;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
--let SEARCH_PATTERN= \[Warning\] InnoDB: Cannot shrink the system tablespace
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||
WHERE engine = 'innodb'
|
||||
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||
|
||||
# Ran out of buffer pool
|
||||
let $restart_parameters=--debug_dbug=+d,shrink_buffer_pool_full;
|
||||
--source include/restart_mysqld.inc
|
||||
|
2
mysql-test/suite/innodb/t/undo_leak.opt
Normal file
2
mysql-test/suite/innodb/t/undo_leak.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--innodb_undo_tablespaces=0
|
||||
--innodb_sys_tablespaces
|
26
mysql-test/suite/innodb/t/undo_leak.test
Normal file
26
mysql-test/suite/innodb/t/undo_leak.test
Normal file
@ -0,0 +1,26 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
let $restart_parameters=--debug_dbug=d,undo_segment_leak;
|
||||
--source include/restart_mysqld.inc
|
||||
SET GLOBAL INNODB_FILE_PER_TABLE=0;
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)ENGINE=InnoDB;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
UPDATE t1 SET f1 = f1 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f2 = f2 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f1 = f2 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f2 = f1 + 1 WHERE f1 > 1000;
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
set GLOBAL innodb_fast_shutdown=0;
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
||||
let $restart_parameters=;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
3
mysql-test/suite/innodb/t/undo_leak_fail.opt
Normal file
3
mysql-test/suite/innodb/t/undo_leak_fail.opt
Normal file
@ -0,0 +1,3 @@
|
||||
--innodb_data_file_path=ibdata1:10M:autoextend:autoshrink
|
||||
--innodb_undo_tablespaces=0
|
||||
--innodb_sys_tablespaces
|
119
mysql-test/suite/innodb/t/undo_leak_fail.test
Normal file
119
mysql-test/suite/innodb/t/undo_leak_fail.test
Normal file
@ -0,0 +1,119 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
call mtr.add_suppression("InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0");
|
||||
call mtr.add_suppression("InnoDB: :autoshrink failed to read the used segment");
|
||||
call mtr.add_suppression("InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FULL list");
|
||||
call mtr.add_suppression("InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FREE list");
|
||||
call mtr.add_suppression("InnoDB: :autoshrink failed to free the segment");
|
||||
call mtr.add_suppression("Found .* prepared XA transactions");
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
||||
|
||||
SET GLOBAL INNODB_FILE_PER_TABLE=0;
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)STATS_PERSISTENT=0, ENGINE=InnoDB;
|
||||
XA START 'x';
|
||||
insert into t1 values (1, 1);
|
||||
XA END 'x';
|
||||
XA PREPARE 'x';
|
||||
set GLOBAL innodb_fast_shutdown=0;
|
||||
--source include/restart_mysqld.inc
|
||||
--echo # Fail to free the segment due to XA PREPARE transaction
|
||||
let SEARCH_PATTERN= InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
XA COMMIT 'x';
|
||||
DROP TABLE t1;
|
||||
|
||||
let $restart_parameters=--debug_dbug=d,undo_segment_leak;
|
||||
--source include/restart_mysqld.inc
|
||||
SET GLOBAL INNODB_FILE_PER_TABLE=0;
|
||||
CREATE TABLE t1(f1 INT NOT NULL, f2 INT NOT NULL)STATS_PERSISTENT=0, ENGINE=InnoDB;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_4096;
|
||||
UPDATE t1 SET f1 = f1 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f2 = f2 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f1 = f2 + 1 WHERE f1 > 1000;
|
||||
UPDATE t1 SET f2 = f1 + 1 WHERE f1 > 1000;
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
||||
let $shutdown_timeout=0;
|
||||
let $restart_parameters=--debug_dbug=d,unused_undo_free_fail_1;
|
||||
--source include/restart_mysqld.inc
|
||||
|
||||
let $shutdown_timeout=;
|
||||
--echo # Fail to free the segment due to previous shutdown
|
||||
--let SEARCH_PATTERN= InnoDB: Cannot free the unused segments in system tablespace because a previous shutdown was not with innodb_fast_shutdown=0
|
||||
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
||||
SET GLOBAL innodb_fast_shutdown= 0;
|
||||
|
||||
--echo # Fail to free the segment while finding the used segments
|
||||
let $restart_parameters=--debug_dbug=d,unused_undo_free_fail_2;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink failed to read the used segment;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FULL list;
|
||||
--source include/search_pattern_in_file.inc
|
||||
SET GLOBAL innodb_fast_shutdown= 0;
|
||||
|
||||
--echo # Fail to free the segment while finding the used segments
|
||||
let $restart_parameters=--debug_dbug=d,unused_undo_free_fail_3;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink failed due to .* in FSP_SEG_INODES_FREE list;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
SET GLOBAL innodb_fast_shutdown= 0;
|
||||
|
||||
--echo # Fail to free the segment while freeing the unused segments
|
||||
let $restart_parameters=--debug_dbug=d,unused_undo_free_fail_4;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink failed to free the segment .* in page .*;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SET GLOBAL innodb_fast_shutdown= 0;
|
||||
|
||||
--echo # Fail to free the segment while freeing the used segments
|
||||
let $restart_parameters=--debug_dbug=d,unused_undo_free_fail_5;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT IF(file_size>10485760,'ok',file_size) FROM information_schema.innodb_sys_tablespaces WHERE space=0;
|
||||
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink failed to free the segment .* in page .*;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
SET GLOBAL innodb_fast_shutdown= 0;
|
||||
let $restart_parameters=;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
||||
|
||||
--echo # Fail to reset the TRX_SYS_FSEG_HEADER during undo tablespace
|
||||
--echo # reinitialization. garbage_collect() shouldn't free the
|
||||
--echo # TRX_SYS_FSEG_HEADER index node
|
||||
set global innodb_fast_shutdown=0;
|
||||
let $restart_parameters=--innodb_undo_tablespaces=2 --debug_dbug=d,sys_fseg_header_fail;
|
||||
--source include/restart_mysqld.inc
|
||||
let SEARCH_PATTERN= InnoDB: :autoshrink freed the segment .* in page .*;
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
--source include/search_pattern_in_file.inc
|
||||
let $restart_parameters=;
|
||||
set global innodb_fast_shutdown=0;
|
||||
--source include/restart_mysqld.inc
|
||||
SELECT NAME, FILE_SIZE FROM information_schema.innodb_sys_tablespaces WHERE SPACE = 0;
|
@ -39,7 +39,7 @@ EOF
|
||||
|
||||
--source include/start_mysqld.inc
|
||||
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
|
||||
let SEARCH_PATTERN= Restoring page \[page id: space=1, page number=0\] of datafile '.*undo001' from the doublewrite buffer.;
|
||||
let SEARCH_PATTERN= Recovered page \\[page id: space=1, page number=0\\] to '.*undo001' from the doublewrite buffer\\.;
|
||||
--source include/search_pattern_in_file.inc
|
||||
|
||||
check table t1;
|
||||
|
98
mysql-test/suite/innodb/t/xa_prepare_unlock_unmodified.test
Normal file
98
mysql-test/suite/innodb/t/xa_prepare_unlock_unmodified.test
Normal file
@ -0,0 +1,98 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
SET @old_innodb_enable_xap_unlock_unmodified_for_primary_debug=
|
||||
@@GLOBAL.innodb_enable_xap_unlock_unmodified_for_primary_debug;
|
||||
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= 1;
|
||||
|
||||
# Make sure there is no dynamic memory allocation during getting offsets for
|
||||
# 32 columns of secondary index with 32 columns of primary index in
|
||||
# lock_rec_unlock_unmodified().
|
||||
DELIMITER $$;
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(
|
||||
SELECT CONCAT(
|
||||
'CREATE TABLE t1(pk',
|
||||
GROUP_CONCAT(seq SEPARATOR ' INT, pk'), ' INT, a',
|
||||
GROUP_CONCAT(seq SEPARATOR ' INT, a'), ' INT, b',
|
||||
GROUP_CONCAT(seq SEPARATOR ' INT, b'), ' INT, c INT, PRIMARY KEY(pk',
|
||||
GROUP_CONCAT(seq SEPARATOR ', pk'), '), INDEX i1(a',
|
||||
GROUP_CONCAT(seq SEPARATOR ', a'), '), INDEX i2(b',
|
||||
GROUP_CONCAT(seq SEPARATOR ', b'), ')) ENGINE=InnoDB;')
|
||||
FROM seq_1_to_32);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(
|
||||
SELECT CONCAT(
|
||||
'INSERT INTO t1 VALUES (',
|
||||
GROUP_CONCAT('1' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('1' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('1' SEPARATOR ','), ',0), (',
|
||||
|
||||
GROUP_CONCAT('2' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('1' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('2' SEPARATOR ','), ',0), (',
|
||||
|
||||
GROUP_CONCAT('3' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('2' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('1' SEPARATOR ','), ',0), (',
|
||||
|
||||
GROUP_CONCAT('4' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('2' SEPARATOR ','), ',',
|
||||
GROUP_CONCAT('2' SEPARATOR ','), ',0);')
|
||||
FROM seq_1_to_32);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
SET @old_timeout= @@GLOBAL.innodb_lock_wait_timeout;
|
||||
SET GLOBAL innodb_lock_wait_timeout= 1;
|
||||
|
||||
XA START "t1";
|
||||
UPDATE t1 FORCE INDEX (i2) SET c=c+1 WHERE a1=1 AND b1=1;
|
||||
XA END "t1";
|
||||
# If there is dynamic memory allocation during getting offsets for
|
||||
# 32 columns of secondary index with 32 columns of primary index in
|
||||
# lock_rec_unlock_unmodified(), the following statement will cause assertion
|
||||
# failure in debug build.
|
||||
XA PREPARE "t1";
|
||||
|
||||
--connect(con1,localhost,root,,)
|
||||
# (pk, 2, 1, 0) record is X-locked but not modified in clustered index with the
|
||||
# above XA transaction, if the bug is not fixed, the following SELECT will be
|
||||
# blocked by the XA transaction if XA PREPARE does not release the unmodified
|
||||
# record.
|
||||
SELECT a1, b1, c FROM t1 FORCE INDEX (i1) WHERE a1=2 AND b1=1 FOR UPDATE;
|
||||
--disconnect con1
|
||||
|
||||
--connection default
|
||||
XA COMMIT "t1";
|
||||
|
||||
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug=
|
||||
@old_innodb_enable_xap_unlock_unmodified_for_primary_debug;
|
||||
|
||||
SET GLOBAL innodb_lock_wait_timeout= @old_timeout;
|
||||
|
||||
# Check that we can't create secondary index with more than 32 columns.
|
||||
DELIMITER $$;
|
||||
--error ER_TOO_MANY_KEY_PARTS
|
||||
BEGIN NOT ATOMIC
|
||||
DECLARE c TEXT DEFAULT(
|
||||
SELECT CONCAT(
|
||||
'ALTER TABLE t1 ADD COLUMN d',
|
||||
GROUP_CONCAT(seq SEPARATOR ' INT, ADD COLUMN d'),
|
||||
' INT, ADD INDEX i3(d',
|
||||
GROUP_CONCAT(seq SEPARATOR ', d'), ');')
|
||||
FROM seq_1_to_33);
|
||||
EXECUTE IMMEDIATE c;
|
||||
END;
|
||||
$$
|
||||
DELIMITER ;$$
|
||||
|
||||
DROP TABLE t1;
|
||||
--source include/wait_until_count_sessions.inc
|
1
mysql-test/suite/innodb/t/xa_unlock_unmodified.opt
Normal file
1
mysql-test/suite/innodb/t/xa_unlock_unmodified.opt
Normal file
@ -0,0 +1 @@
|
||||
--innodb_purge_threads=1
|
86
mysql-test/suite/innodb/t/xa_unlock_unmodified.test
Normal file
86
mysql-test/suite/innodb/t/xa_unlock_unmodified.test
Normal file
@ -0,0 +1,86 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/count_sessions.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
SET @old_innodb_enable_xap_unlock_unmodified_for_primary_debug=
|
||||
@@GLOBAL.innodb_enable_xap_unlock_unmodified_for_primary_debug;
|
||||
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug= 1;
|
||||
|
||||
SET @saved_dbug = @@GLOBAL.debug_dbug;
|
||||
|
||||
CREATE TABLE t(id INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
|
||||
|
||||
--let $i = 2
|
||||
|
||||
while ($i) {
|
||||
--source include/wait_all_purged.inc
|
||||
|
||||
INSERT INTO t VALUES (10), (20), (30);
|
||||
|
||||
--connect(prevent_purge,localhost,root,,)
|
||||
start transaction with consistent snapshot;
|
||||
|
||||
--connection default
|
||||
DELETE FROM t WHERE id = 20;
|
||||
|
||||
SET @@GLOBAL.debug_dbug=
|
||||
"+d,enable_row_purge_remove_clust_if_poss_low_sync_point";
|
||||
|
||||
# Cover both lock_release_on_prepare() and lock_release_on_prepare_try()
|
||||
# functions
|
||||
if ($i == 1) {
|
||||
SET @@GLOBAL.debug_dbug="+d,skip_lock_release_on_prepare_try";
|
||||
}
|
||||
|
||||
XA START '1';
|
||||
UPDATE t SET id=40 WHERE id=30;
|
||||
XA END '1';
|
||||
|
||||
--connection prevent_purge
|
||||
COMMIT;
|
||||
|
||||
# stop purge worker after it requested page X-latch, but before
|
||||
# lock_update_delete() call
|
||||
SET DEBUG_SYNC=
|
||||
'now WAIT_FOR row_purge_remove_clust_if_poss_low_before_delete';
|
||||
SET @@GLOBAL.debug_dbug=
|
||||
"-d,enable_row_purge_remove_clust_if_poss_low_sync_point";
|
||||
|
||||
--connection default
|
||||
# lock_rec_unlock_unmodified() is executed either under lock_sys.wr_lock() or
|
||||
# under a combination of lock_sys.rd_lock() + record locks hash table cell
|
||||
# latch. Stop it before page latch request.
|
||||
SET DEBUG_SYNC=
|
||||
"lock_rec_unlock_unmodified_start SIGNAL lock_sys_latched WAIT_FOR cont";
|
||||
--send XA PREPARE '1'
|
||||
|
||||
--connection prevent_purge
|
||||
# let purge thread to continue execution and invoke lock_update_delete(),
|
||||
# which, in turns, requests locks_sys related latches.
|
||||
SET DEBUG_SYNC= 'now SIGNAL row_purge_remove_clust_if_poss_low_cont';
|
||||
SET DEBUG_SYNC= 'now SIGNAL cont';
|
||||
--disconnect prevent_purge
|
||||
|
||||
--connection default
|
||||
# deadlock if the bug is not fixed, as lock_rec_unlock_unmodified() requests
|
||||
# page latch acquired by purge worker, and the purge worker requests lock_sys
|
||||
# related latches in lock_update_delete() call, acquired by the current XA
|
||||
# in lock_rec_unlock_unmodified() caller.
|
||||
--reap
|
||||
XA COMMIT '1';
|
||||
|
||||
SET DEBUG_SYNC="RESET";
|
||||
|
||||
TRUNCATE TABLE t;
|
||||
|
||||
--dec $i
|
||||
}
|
||||
|
||||
SET @@GLOBAL.debug_dbug = @saved_dbug;
|
||||
DROP TABLE t;
|
||||
|
||||
SET GLOBAL innodb_enable_xap_unlock_unmodified_for_primary_debug=
|
||||
@old_innodb_enable_xap_unlock_unmodified_for_primary_debug;
|
||||
|
||||
--source include/wait_until_count_sessions.inc
|
Reference in New Issue
Block a user