-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathbinlog_row_create_select_crash.test
45 lines (39 loc) · 1.34 KB
/
binlog_row_create_select_crash.test
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
# ==== Purpose ====
#
# Verify that their is no crash any more while executing a
# 'CREATE...SELECT' statement even if it is interrupted at
# debug point 'mysql_lock_tables_kill_query' in the middle
# and 'CREATE TABLE' event was not logged when
# binlog_format='row', gtid_mode=off and autocommit=0.
#
# ==== Implementation ====
#
# 1. Disable autocommit.
# 2. Create a table with select.
# 3. Drop the table from another connection.
# 4. Set DEBUG= '+d,mysql_lock_tables_kill_query'.
# 5. There is no crash while executing a 'CREATE ... SELECT'
# statement even if it is interrupted at the above debug
# point in the middle.
# 6. Verify that 'CREATE TABLE' event was not logged.
#
# ==== References ====
#
# Bug#21114464 CRASHES WITH CONCURRENT DDL+KILL+BIN LOGGING
--source include/have_binlog_format_row.inc
--source include/have_debug.inc
--connection default
SET SESSION autocommit= 0;
CREATE TABLE t1 AS SELECT 1 AS col1;
--connect(con1,localhost,root)
--connection con1
DROP TABLE t1;
--connection default
RESET BINARY LOGS AND GTIDS;
SET SESSION DEBUG= '+d,mysql_lock_tables_kill_query';
--error ER_QUERY_INTERRUPTED
CREATE TABLE t2 AS SELECT 1 AS col1;
SET SESSION DEBUG= '-d,mysql_lock_tables_kill_query';
--echo # Verify that 'CREATE TABLE t2' event was not logged.
--source include/rpl/deprecated/show_binlog_events.inc
SET SESSION autocommit= 1;