Debian Codegraph @

mysql-test/suite/binlog/t/binlog_xa_recover_using_new_server_id.test

raw
1 # This test verifies attempt to xa recover using a new server id that
2 # different from the transaction's original server_id.
3 #
4
5 --source include/have_innodb.inc
6 --source include/have_debug.inc
7 --source include/have_binlog_format_row.inc
8 # Valgrind does not work well with test that crashes the server
9 --source include/not_valgrind.inc
10
11
12 --echo ========= Set server_id to 99 and prepare test table.
13 SET GLOBAL server_id= 99;
14 CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
15
16
17 --echo ========= Crash the server.
18 --write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
19 wait-binlog_xa_recover_using_new_server_id.test
20 EOF
21 SET SESSION debug_dbug="+d,crash_commit_after_log";
22 --error 2006,2013
23 INSERT INTO t1 VALUES (1, NULL);
24
25
26 --echo ========= Restart the server with default config file in which server_id= 1.
27 --append_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
28 restart-binlog_xa_recover_using_new_server_id.test
29 EOF
30
31
32 --echo ========= Check that recover succeeds and server is up.
33 connection default;
34 --enable_reconnect
35 --source include/wait_until_connected_again.inc
36
37
38 --echo ========= Check that all transactions are recovered.
39 SELECT a FROM t1 ORDER BY a;
40
41
42 --echo ========= Cleanup.
43 connection default;
44 DROP TABLE t1;