File: rpl_mts_delete_file_event.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (47 lines) | stat: -rw-r--r-- 1,392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# ==== Purpose ====
#
# This test will verify if a MTS enabled server will handle a Delete_file
# event correctly.
#
# The test will create a non-transactional table, insert some data on it and
# then will try to execute a LOAD DATA INFILE statement into the table but
# containing data that will violate the table primary key. This statement
# will be logged into the binary log as the following sequence of events:
# - QUERY(BEGIN)
# - BEGIN_LOAD_QUERY
# - DELETE_FILE
# - QUERY(COMMIT)
#
# ==== Related Bugs and Worklogs ====
#
# BUG#19552923: ASSERTION `!WORKER' FAILED FOR DELETE_FILE LOG EVENT IN MTS
#

--source include/force_myisam_default.inc
--source include/have_myisam.inc
--source include/have_binlog_format_statement.inc
--source include/master-slave.inc

# Creates a non-transactional table
CREATE TABLE t1 (c1 INT KEY) ENGINE=MyISAM;

# Insert some data into the table to generate an error on LOAD DATA INSFILE
INSERT INTO t1 VALUES (1);

# Generates the file to be loaded
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--write_file $MYSQLTEST_VARDIR/tmp/data01
1
EOF

# Generates the Delete_file event by failing the LOAD DATA INFILE statement
# in the non-transactional table.
--error ER_DUP_ENTRY
--eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/data01' INTO TABLE t1

#
# Cleanup
#
--remove_file $MYSQLTEST_VARDIR/tmp/data01
DROP TABLE t1;
--source include/rpl_end.inc