mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Adjust the tests for MariaDB.
New added test case: alter_kill in innodb suite.
This commit is contained in:
@ -3,9 +3,12 @@
|
||||
#
|
||||
SET GLOBAL innodb_file_per_table=1;
|
||||
CREATE TABLE bug16720368_1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
connect con1,localhost,root;
|
||||
CREATE TABLE bug16720368 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
|
||||
INSERT INTO bug16720368 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8);
|
||||
connection default;
|
||||
# Cleanly shutdown mysqld
|
||||
disconnect con1;
|
||||
# Corrupt FIL_PAGE_OFFSET in bug16720368.ibd,
|
||||
# and update the checksum to the "don't care" value.
|
||||
# Restart mysqld
|
||||
@ -15,22 +18,17 @@ SELECT COUNT(*) FROM bug16720368;
|
||||
COUNT(*)
|
||||
8
|
||||
INSERT INTO bug16720368_1 VALUES(1);
|
||||
# Kill the server to do an unclean shutdown.
|
||||
# The corruption should not prevent startup after crash recovery,
|
||||
# because there is no redo log for the corrupted tablespace.
|
||||
# The table is unaccessible, because after a crash we will
|
||||
# validate the tablespace header.
|
||||
SELECT COUNT(*) FROM bug16720368;
|
||||
ERROR 42S02: Table 'test.bug16720368' doesn't exist
|
||||
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
|
||||
INSERT INTO bug16720368 VALUES(0,1);
|
||||
ERROR 42S02: Table 'test.bug16720368' doesn't exist
|
||||
# Kill the server to do an unclean shutdown.
|
||||
ERROR 42S02: Table 'test.bug16720368' doesn't exist in engine
|
||||
# The table is readable thanks to innodb-force-recovery.
|
||||
SELECT COUNT(*) FROM bug16720368;
|
||||
COUNT(*)
|
||||
8
|
||||
INSERT INTO bug16720368 VALUES(0,1);
|
||||
ERROR HY000: Operation not allowed when innodb_forced_recovery > 0.
|
||||
# Shut down the server cleanly to hide the corruption.
|
||||
# The table is accessible, because after a clean shutdown we will
|
||||
# NOT validate the tablespace header.
|
||||
@ -38,8 +36,7 @@ ERROR HY000: Operation not allowed when innodb_forced_recovery > 0.
|
||||
# any pages, because that would hit the corruption on page 0.
|
||||
SELECT COUNT(*) FROM bug16720368;
|
||||
COUNT(*)
|
||||
8
|
||||
INSERT INTO bug16720368 VALUES(0,1);
|
||||
9
|
||||
# Shut down the server to uncorrupt the data.
|
||||
# Restart the server after uncorrupting the file.
|
||||
INSERT INTO bug16720368 VALUES(9,1);
|
||||
@ -55,12 +52,17 @@ SET GLOBAL innodb_file_per_table=1;
|
||||
CREATE TEMPORARY TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
BEGIN;
|
||||
INSERT INTO t1 VALUES(42);
|
||||
connect con1,localhost,root;
|
||||
CREATE TABLE bug16735660 (a INT PRIMARY KEY) ENGINE=InnoDB;
|
||||
XA START 'x';
|
||||
INSERT INTO bug16735660 VALUES(1),(2),(3);
|
||||
XA END 'x';
|
||||
XA PREPARE 'x';
|
||||
connection default;
|
||||
# Kill the server
|
||||
disconnect con1;
|
||||
# Attempt to start without an *.ibd file.
|
||||
FOUND 1 /\[ERROR\] InnoDB: Tablespace [0-9]+ was not found at .*test.bug16735660.ibd/ in mysqld.1.err
|
||||
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
||||
SELECT * FROM bug16735660;
|
||||
a
|
||||
|
Reference in New Issue
Block a user