Bug #19535 mysql-test-run cannot handle crashing test cases
Submitted: 4 May 2006 11:23 Modified: 3 Aug 2006 18:22
Reporter: Mikael Ronström Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Tests Severity:S4 (Feature request)
Version: OS:
Assigned to: Magnus Blåudd CPU Architecture:Any

[4 May 2006 11:23] Mikael Ronström
Description:
In verifying crashing tests for ALTER TABLE ADD/DROP/REORGANIZE partition
it is required that mysql-test-run can handle crashes of MySQL Server when test
case has declared that a particular statement is expected to crash the MySQL Server.

A typical test case is:
CREATE TABLE t1 (a int)
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (3),
 PARTITION p1 VALUES LESS THAN (4));

SET SESSION debug=d,+crash_drop_partition_3;
--error CRASH
ALTER TABLE t1 DROP PARTITION p1;
SHOW CREATE TABLE t1;

So here ALTER TABLE is crashing the MySQL Server and before SHOW CREATE TABLE is
executed the server is restarted and its recovery code is executed and the statement
verifies that the recovery code was executed as expected.

How to repeat:
CREATE TABLE t1 (a int)
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (3),
 PARTITION p1 VALUES LESS THAN (4));

SET SESSION debug=d,+crash_drop_partition_3;
--error CRASH
ALTER TABLE t1 DROP PARTITION p1;
SHOW CREATE TABLE t1;

Suggested fix:
Fix such that mysql-test-run can handle error injection of crashes and still continue the
test case.
[18 Jul 2006 15:23] Magnus Blåudd
Managed to reproduce with this small test as well.

CREATE TABLE t1(a int) engine=innodb;
START TRANSACTION;
insert into t1 values(9);

SET SESSION debug="d,crash_commit_before";
#--error CRASH
COMMIT;

Just have to make sure the crashed mysqld is restarted again after the expeceted crash. :)
[20 Jul 2006 11:24] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/9375
[3 Aug 2006 8:56] Magnus Blåudd
Pushed to 5.1.12
[3 Aug 2006 18:22] Paul DuBois
No changelog entry needed.