Debian Codegraph @

mysql-test/suite/rpl/t/rpl_mts_delete_file_event.test

raw
1 # ==== Purpose ====
2 #
3 # This test will verify if a MTS enabled server will handle a Delete_file
4 # event correctly.
5 #
6 # The test will create a non-transactional table, insert some data on it and
7 # then will try to execute a LOAD DATA INFILE statement into the table but
8 # containing data that will violate the table primary key. This statement
9 # will be logged into the binary log as the following sequence of events:
10 # - QUERY(BEGIN)
11 # - BEGIN_LOAD_QUERY
12 # - DELETE_FILE
13 # - QUERY(COMMIT)
14 #
15 # ==== Related Bugs and Worklogs ====
16 #
17 # BUG#19552923: ASSERTION `!WORKER' FAILED FOR DELETE_FILE LOG EVENT IN MTS
18 #
19
20 --source include/force_myisam_default.inc
21 --source include/have_myisam.inc
22 --source include/have_binlog_format_statement.inc
23 --source include/master-slave.inc
24
25 # Creates a non-transactional table
26 CREATE TABLE t1 (c1 INT KEY) ENGINE=MyISAM;
27
28 # Insert some data into the table to generate an error on LOAD DATA INSFILE
29 INSERT INTO t1 VALUES (1);
30
31 # Generates the file to be loaded
32 --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
33 --write_file $MYSQLTEST_VARDIR/tmp/data01
34 1
35 EOF
36
37 # Generates the Delete_file event by failing the LOAD DATA INFILE statement
38 # in the non-transactional table.
39 --error ER_DUP_ENTRY
40 --eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/data01' INTO TABLE t1
41
42 #
43 # Cleanup
44 #
45 --remove_file $MYSQLTEST_VARDIR/tmp/data01
46 DROP TABLE t1;
47 --source include/rpl_end.inc