mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MWL#116: After-review fixes.
Also implement the InnoDB changes for group commit into innodb_plugin.
This commit is contained in:
82
mysql-test/suite/innodb_plugin/t/group_commit_crash.test
Normal file
82
mysql-test/suite/innodb_plugin/t/group_commit_crash.test
Normal file
@ -0,0 +1,82 @@
|
||||
# Testing group commit by crashing a few times.
|
||||
# Test adapted from the Facebook patch: lp:mysqlatfacebook
|
||||
--source include/not_embedded.inc
|
||||
# Don't test this under valgrind, memory leaks will occur
|
||||
--source include/not_valgrind.inc
|
||||
|
||||
# Binary must be compiled with debug for crash to occur
|
||||
--source include/have_debug.inc
|
||||
--source include/have_innodb_plugin.inc
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
let $file_format_check=`SELECT @@innodb_file_format_check`;
|
||||
CREATE TABLE t1(a CHAR(255),
|
||||
b CHAR(255),
|
||||
c CHAR(255),
|
||||
d CHAR(255),
|
||||
id INT AUTO_INCREMENT,
|
||||
PRIMARY KEY(id)) ENGINE=InnoDB;
|
||||
create table t2 like t1;
|
||||
delimiter //;
|
||||
create procedure setcrash(IN i INT)
|
||||
begin
|
||||
CASE i
|
||||
WHEN 1 THEN SET SESSION debug="d,crash_commit_after_prepare";
|
||||
WHEN 2 THEN SET SESSION debug="d,crash_commit_after_log";
|
||||
WHEN 3 THEN SET SESSION debug="d,crash_commit_before_unlog";
|
||||
WHEN 4 THEN SET SESSION debug="d,crash_commit_after";
|
||||
WHEN 5 THEN SET SESSION debug="d,crash_commit_before";
|
||||
ELSE BEGIN END;
|
||||
END CASE;
|
||||
end //
|
||||
delimiter ;//
|
||||
# Avoid getting a crashed mysql.proc table.
|
||||
FLUSH TABLES;
|
||||
|
||||
let $numtests = 5;
|
||||
|
||||
let $numinserts = 10;
|
||||
while ($numinserts)
|
||||
{
|
||||
dec $numinserts;
|
||||
INSERT INTO t2(a, b, c, d) VALUES ('a', 'b', 'c', 'd');
|
||||
}
|
||||
|
||||
--enable_reconnect
|
||||
|
||||
while ($numtests)
|
||||
{
|
||||
SET binlog_format= mixed;
|
||||
RESET MASTER;
|
||||
|
||||
START TRANSACTION;
|
||||
insert into t1 select * from t2;
|
||||
# Write file to make mysql-test-run.pl expect crash
|
||||
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
|
||||
|
||||
eval call setcrash($numtests);
|
||||
|
||||
# Run the crashing query
|
||||
--error 2006,2013
|
||||
COMMIT;
|
||||
|
||||
# Poll the server waiting for it to be back online again.
|
||||
--source include/wait_until_connected_again.inc
|
||||
|
||||
# table and binlog should be in sync.
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
--replace_column 2 # 5 #
|
||||
SHOW BINLOG EVENTS LIMIT 2,1;
|
||||
|
||||
delete from t1;
|
||||
|
||||
dec $numtests;
|
||||
}
|
||||
|
||||
# final cleanup
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP PROCEDURE setcrash;
|
||||
--disable_query_log
|
||||
eval SET GLOBAL innodb_file_format_check=$file_format_check;
|
||||
--enable_query_log
|
Reference in New Issue
Block a user