1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-13 20:03:16 +03:00
Files
mariadb/mysql-test/suite/parts/inc/partition_mgm_crash.inc
Mattias Jonsson 9a7a64acdb Bug#53676: Unexpected errors and possible table
corruption on ADD PARTITION and LOCK TABLE
Bug#53770: Server crash at handler.cc:2076 on
           LOAD DATA after timed out COALESCE PARTITION

5.5 fix for:
Bug#51042: REORGANIZE PARTITION can leave table in an
           inconsistent state in case of crash
Needs to be back-ported to 5.1

5.5 fix for:
Bug#50418: DROP PARTITION does not interact with
           transactions

Main problem was non-persistent operations done
before meta-data lock was taken (53770+53676).
And 53676 needed to keep the table/partitions opened and locked
while copying the data to the new partitions.

Also added thorough tests to spot some additional bugs
in the ddl_log code, which could result in bad state
between the .frm and partitions.

Collapsed patch, includes all fixes required from the reviewers.
2010-08-13 09:50:25 +02:00

35 lines
1.8 KiB
SQL

# collection of tests which crashes the server and checks recovery.
# also using error injection to test recovery of failures.
# uses $DATADIR and $engine
--echo #
--echo # Bug#53676: Unexpected errors and possible table corruption on
--echo # ADD PARTITION and LOCK TABLE
--echo # Bug#53770: Server crash at handler.cc:2076 on LOAD DATA
--echo # after timed out COALESCE PARTITION
--echo # Extended crash recovery testing of fast_alter_partition_table.
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
let $create_statement= CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = $engine
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9),
PARTITION p10 VALUES IN (11,12,13,14,15,16,17,18,19));
let $insert_statement= INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1");
let $crash_statement= ALTER TABLE t1 ADD PARTITION
(PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
--source suite/parts/inc/partition_crash_add.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_add.inc
let $crash_statement= ALTER TABLE t1 DROP PARTITION p10;
--source suite/parts/inc/partition_crash_drop.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_drop.inc
let $crash_statement= ALTER TABLE t1 REORGANIZE PARTITION p10 INTO
(PARTITION p10 VALUES IN (10,11,12,13,14,15,16,17,18,19),
PARTITION p20 VALUES IN (20,21,22,23,24,25,26,27,28,29));
--source suite/parts/inc/partition_crash_change.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_change.inc