Skip to content

Commit d340598

Browse files
author
Sven Sandberg
committed
WL#7083 step 6.5. GTID-violations: Fix CREATE...SELECT matching zero rows.
Background 1: When binlog_format = row, CREATE ... SELECT is logged in two pieces, like: Anonymous_Gtid query_log_event(CREATE TABLE without SELECT) Anonymous_Gtid query_log_event(BEGIN) ...row events... query_log_event(COMMIT) (or Xid_log_event) Internally, there is a call to MYSQL_BIN_LOG::commit after the table has been created and before the rows are selected. When gtid_next='ANONYMOUS', we must not release anonymous ownership for the commit occurring in the middle of the statement (since that would allow a concurrent client to set gtid_mode=on, making it impossible to commit the rest of the statement). Also, the commit in the middle of the statement should not decrease the counter of ongoing GTID-violating transactions, since that would allow a concurrent client to set ENFORCE_GTID_CONSISTENCY=ON even if there is an ongoing transaction that violates GTID-consistency. The logic to skip releasing anonymous ownership and skip decreasing the counter is as follows. Before calling mysql_bin_log.commit, it sets the flag thd->is_commit_in_middle_of_statement. Eventually, mysql_bin_log.commit calls gtid_state->update_on_commit, which calls gtid_state->update_gtids_impl, which reads the thd->is_commit_in_middle_of_statement and accordingly decides to skip releasing anonymous ownership and/or skips decreasing the counter. Problem 1: When thd->is_commit_in_middle_of_statement has been set, it is crucial that there is another call to update_gtids_impl when the transaction ends (otherwise the session will keep holding anonymous ownership and will not decrease the counters). Normally, this happens because mysql_bin_log.commit is always called, and mysql_bin_log.commit normally invokes ordered_commit, which calls update_gtids_impl. However, in case the SELECT part of the statement does not find any rows, mysql_bin_log.commit skips the call to ordered_commit, so update_gtids_impl does not get called. This is the first problem we fix in this commit. Fix 1: We fix this problem as follows. After calling mysql_bin_log.commit to log the CREATE part of CREATE...SELECT, the CREATE...SELECT code sets thd->pending_gtid_state_update=true (this is a new flag that we introduce in this patch). If the flag is set, update_gtids_impl clears it. At the end of mysql_bin_log.commit, we check the flag to see if update_gtids_impl has been called by any function invoked by mysql_bin_log.commit. If not, i.e., if the flag is still true at the end of mysql_bin_log.commit, it means we have reached the corner case where update_gtids_impl was skipped. Thus we call it explicitly from mysql_bin_log.commit. Background 2: GTID-violating DDL (CREATE...SELECT and CREATE TEMPORARY) is detected in is_ddl_gtid_compatible, called from gtid_pre_statement_checks, which is called from mysql_parse just before the implicit pre-commit. is_ddl_gtid_compatible determines whether an error or warning or nothing is to be generated, and whether to increment the counters of GTID- violating transactions. In case an error is generated, it is important that the error happens before the implicit commit, so that the statement fails before it commits the ongoing transaction. Problem 2: In case a warning is to be generated, and there is an ongoing transaction, the implicit commit will write to the binlog, and thus it will call gtid_state->update_gtids_impl, which will decrease the counters of GTID-violating transactions. Thus, the counters will be zero for the duration of the transaction. Fix 2: We call is_ddl_gtid_compatible *both* before the implicit commit and after the implicit commit. If an error is to be generated, the error is generated before the commit. If a warning is to be generated and/or the counter of GTID-violating transactions is to be increased, then this happens after the commit. Code changes #1: @sql/binlog.cc - Move MYSQL_BIN_LOG::commit to a new function MYSQL_BIN_LOG::write_binlog_and_commit_engine. Make MYSQL_BIN_LOG::commit call this function, and after the return check thd->pending_gtid_state_update to see if another call to gtid_state->update_on_[commit|rollback] is needed. - Simplify MYSQL_BIN_LOG::write_bin_log_and_commit_engine; remove useless local variable 'error' that would never change its value. @sql/binlog.h: - Declaration of new function. @sql/rpl_gtid_state.cc: - Set thd->pending_gtid_state_update to false at the end of update_gtids_impl. Code changes #2: @sql/binlog.cc: - Add two parameters to handle_gtid_consistency and is_ddl_compatible: handle_error is true in the call to is_ddl_gtid_compatible that happens *before* the implicit commit and fals in the call to is_ddl_gtid_compatible that happens *after* the implicit commit. It tells the function to generate the error, if an error is to be generated. The other parameter, handle_nonerror, is true in the call to is_ddl_gtid_compatible that happens *after* the implicit commit and false in the call that happens *before* the implicit commit. It tells the function to generate the warnings and increment the counter, if that needs to be done. @sql/rpl_gtid_execution.cc: - Call is_ddl_gtid_compatible after the implicit commit. Pass the two new parameters to the function. @sql/sql_class.h: - Update prototype for is_ddl_gtid_compatible. @sql/sql_insert.cc: - Set thd->pending_gtid_state_update = true after committing the CREATE part of a CREATE...SELECT. Misc changes: @sql/binlog.cc - Add DEBUG_SYNC symbol end_decide_logging_format used in tests. @sql/rpl_gtid_state.cc: - For modularity, move out parts of update_gtids_impl to a new function, end_gtid_violating_transaction. - Move the lock/unlock of global_sid_lock into update_gtids_impl. - Make update_gtids_impl release global_sid_lock before the call to end_gtid_violating_transaction, so as to hold it as short as possible. @sql/rpl_gtid.h - Because we release the locks earlier in update_gtids_impl in rpl_gtid_state.cc, we need to acquire the lock again in end_[anonymous|automatic]_gtid_violating_transaction, in order to do some debug assertions. - Add DBUG_PRINT for the counters. Test changes: - Split binlog_enforce_gtid_consistency into six tests, depending on the type of scenarios it tests: Three classes of GTID-violation: *_create_select_*: test CREATE ... SELECT. *_tmp_*: test CREATE TEMPORARY/DROP TEMPORARY inside a transaction. *_trx_nontrx_*: test combinations of transactional and non-transactional updates in the same statement or in the same transaction. For each class of GTID-violation, one positive and one negative test: *_consistent.test: Cases which are *not* GTID-violating *_violation.test: Cases which *are* GTID-violating. - The general logic of these test is: - extra/binlog_tests/enforce_gtid_consistency.test iterates over all values of GTID_MODE, ENFORCE_GTID_CONSISTENCY, and GTID_NEXT. For each case, it sources file; the name of the sourced file is specified by the file that sources extra/binlog_tests/enforce_gtid_consistency.test - The top-level file in suite/binlog/t invokes extra/binlog_tests/enforce_gtid_consistency.test, specifying one of the filenames extra/binlog_tests/enforce_gtid_consistency_[create_select|tmp| trx_nontrx]_[consistent|violation].test. - Each of the files extra/binlog_tests/enforce_gtid_consistency_[create_select|tmp| trx_nontrx]_[consistent|violation].test sets up a number of test scenarios. Each test scenario is executed by sourcing extra/binlog_tests/enforce_gtid_consistency_statement.inc. - extra/binlog_tests/enforce_gtid_consistency_statement.inc executes the specified statement, checks that warnings are generated and counters incremented/decremented as specified by the caller. - Since the tests set GTID_MODE explicitly, it doesn't make sense to run the test in both combinations GTID_MODE=ON/OFF. However, for the *_trx_nontrx_* cases, it is important to test that it works both with binlog_direct_non_transactional_updates=on and off. The suite is never run with those combinations. To leverage from the combinations GTID_MODE=ON/OFF, we run the test with binlog_direct_non_transactional_updates=on if GTID_MODE=ON, and we run the test with binlog_direct_non_transactional_updates=off if GTID_MODE=OFF.
1 parent a2f345b commit d340598

File tree

34 files changed

+26169
-753
lines changed

34 files changed

+26169
-753
lines changed
Lines changed: 154 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,160 @@
11
# ==== Purpose ====
22
#
3-
# Test many GTID-consistency violations. This file is sourced from
4-
# binlog_enforce_gtid_consistency.test; see that file for details.
3+
# Test that GTID-consistency violations generate warnings or errors,
4+
# or pass with success, as expected.
5+
#
6+
# Generally, the following statement types are considered to be GTID
7+
# consistency violations:
8+
#
9+
# 1. DML statements that mix non-transactional updates with
10+
# transactional updates. (Exception: non-transactional *temporary*
11+
# tables do not count, in case the statement is logged in row
12+
# format.)
13+
#
14+
# 2. Transactions that use non-transactional tables after having used
15+
# transactional tables. (Exception: non-transactional *temporary*
16+
# tables do not count, in case the statement is logged in row
17+
# format.)
18+
#
19+
# 3. CREATE TABLE ... SELECT.
20+
#
21+
# 4. CREATE TEMPORARY TABLE or DROP TEMPORARY TABLE within a
22+
# transaction
23+
#
24+
# A GTID-violating statement can pass with success, generate a
25+
# warning, or generate an error, according to the following rules:
26+
#
27+
# 1. If ENFORCE_GTID_CONSISTENCY=ON, or GTID_NEXT='UUID:NUMBER', or
28+
# (GTID_NEXT='AUTOMATIC' and GTID_MODE=ON or ON_PERMISSIVE),
29+
# generate an error.
30+
#
31+
# 2. Otherwise, if ENFORCE_GTID_CONSISTENCY=WARN, generate a warning.
32+
#
33+
# 3. Otherwise, statement should pass without warning or error.
34+
#
35+
# ==== Implementation ====
36+
#
37+
# Iterate over all values of enforce_gtid_consistency.
38+
# Iterate over all values of gtid_mode.
39+
# For each gtid_next in automatic, anonymus, and GTID:
40+
# source $test_specification
41+
#
42+
# $test_specification must be set by the caller to one of:
43+
# - extra/binlog/enforce_gtid_consistency_temporary.test
44+
# - extra/binlog/enforce_gtid_consistency_create_select.test
45+
# - extra/binlog/enforce_gtid_consistency_trx_nontrx.test
46+
#
47+
# Each of
48+
# extra/binlog/enforce_gtid_consistency_[temporary|create_select|trx_nontrx].test
49+
# contains a number of specific test scenarios. Each test scenario has
50+
# a statement that will be tested. For some scenarios, the expectation
51+
# is that the statement violates GTID consistency, for other scenarios
52+
# the expectation is that the statement does not violate GTID
53+
# consistency. Each scenario sources
54+
# extra/binlog_tests/enforce_gtid_consistency_statement.inc to execute
55+
# the statement and verify that the outcome is as expected.
56+
#
57+
# ==== References ====
58+
#
59+
# WL#3584: Global Transaction Identifiers
60+
# - Created the test.
61+
# WL#7083: GTIDs: set gtid_mode=ON online
62+
# - Rewrote the test to improve coverage and test new logic for
63+
# enforce_gtid_consistency.
64+
65+
# This test uses ONGOING_ANONYMOUS_GTID_VIOLATING_TRANSACTION_COUNT
66+
# and ONGOING_AUTOMATIC_GTID_VIOLATING_TRANSACTION_COUNT, which are
67+
# only define in debug mode.
68+
--source include/have_debug.inc
69+
--source include/have_debug_sync.inc
70+
71+
--source include/have_myisam.inc
72+
--source include/have_innodb.inc
73+
--let $rpl_gtid_utils= 1
74+
--let $rpl_server_count= 1
75+
--let $rpl_topology= none
76+
--source include/rpl_init.inc
77+
78+
--connection server_1
79+
80+
# Disable warnings from binlog_format-unsafe statements, since they
81+
# confuses the logic for checking that a GTID-violation warning was
82+
# generated.
83+
--let $binlog_format= `SELECT @@SESSION.BINLOG_FORMAT`
84+
--let $binlog_direct_non_transactional_updates= `SELECT @@SESSION.BINLOG_DIRECT_NON_TRANSACTIONAL_UPDATES`
85+
SET @old_sql_notes= @@GLOBAL.SQL_NOTES;
86+
SET GLOBAL SQL_NOTES= 0;
87+
SET SESSION SQL_NOTES= 0;
88+
89+
CALL mtr.add_suppression('Statement violates GTID consistency:');
90+
CALL mtr.add_suppression('Unsafe statement written to the binary log');
91+
92+
--let $gtid_next_mask_mode= 1
93+
--let $gtid_next_connection= default
94+
95+
--let $statement_connection= default
96+
--let $auxiliary_connection= server_1_1
97+
98+
--connection $statement_connection
99+
100+
# Foreach enforce_gtid_consistency = 0, 1, 2.
101+
--let $enforce_gtid_consistency= 0
102+
while ($enforce_gtid_consistency < 3)
103+
{
104+
eval SET GLOBAL ENFORCE_GTID_CONSISTENCY = $enforce_gtid_consistency;
105+
--let $enforce_gtid_consistency_text= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('OFF,ERROR,WARN', ',', $enforce_gtid_consistency + 1), ',', -1)`
106+
107+
# Foreach gtid_mode = [3,] 2, 1, 0.
108+
# 3 is only used when enforce_gtid_consistency=1.
109+
SET GLOBAL GTID_MODE = OFF_PERMISSIVE;
110+
SET GLOBAL GTID_MODE = ON_PERMISSIVE;
111+
if ($enforce_gtid_consistency != 1)
112+
{
113+
--let $gtid_mode= 2
114+
}
115+
if ($enforce_gtid_consistency == 1)
116+
{
117+
--let $gtid_mode= 3
118+
SET GLOBAL GTID_MODE = ON;
119+
}
120+
while ($gtid_mode >= 0)
121+
{
122+
eval SET GLOBAL GTID_MODE = $gtid_mode;
123+
--let $gtid_mode_text= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('OFF,OFF_PERMISSIVE,ON_PERMISSIVE,ON', ',', $gtid_mode + 1), ',', -1)`
124+
125+
--echo ######## ENFORCE_GTID_CONSISTENCY=$enforce_gtid_consistency_text GTID_MODE=$gtid_mode_text GTID_NEXT=AUTOMATIC ########
126+
--let $gtid_next= AUTOMATIC
127+
--let $violation_result= $enforce_gtid_consistency
128+
if ($gtid_mode >= 2)
129+
{
130+
--let $violation_result= 1
131+
}
132+
--source $test_file
133+
134+
if ($gtid_mode < 3)
135+
{
136+
--echo ######## ENFORCE_GTID_CONSISTENCY=$enforce_gtid_consistency_text GTID_MODE=$gtid_mode_text GTID_NEXT=ANONYMOUS ########
137+
--let $gtid_next= ANONYMOUS
138+
--let $violation_result= $enforce_gtid_consistency
139+
--source $test_file
140+
}
141+
if ($gtid_mode > 0)
142+
{
143+
--echo ######## ENFORCE_GTID_CONSISTENCY=$enforce_gtid_consistency_text GTID_MODE=$gtid_mode_text GTID_NEXT=GTID ########
144+
--let $gtid_next= GTID
145+
--let $violation_result= 1
146+
--source $test_file
147+
}
148+
149+
--dec $gtid_mode
150+
}
5151

6-
--source extra/binlog_tests/enforce_gtid_consistency_create_select.test
152+
--inc $enforce_gtid_consistency
153+
}
7154

8-
--let $binlog_direct_non_transactional_updates= 0
9-
--source extra/binlog_tests/enforce_gtid_consistency_trx_nontrx.test
155+
--connection server_1
10156

11-
--let $binlog_direct_non_transactional_updates= 1
12-
--source extra/binlog_tests/enforce_gtid_consistency_trx_nontrx.test
157+
SET GLOBAL ENFORCE_GTID_CONSISTENCY = OFF;
158+
SET GLOBAL SQL_NOTES = @old_sql_notes;
13159

14-
--source extra/binlog_tests/enforce_gtid_consistency_temporary.test
160+
--source include/rpl_end.inc

mysql-test/extra/binlog_tests/enforce_gtid_consistency_create_select.test

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
--let $gtid_violation= 0
2+
--let $error_code= 0
3+
--let $statement_ends_transaction= 1
4+
--let $sync_point= before_execute_sql_command
5+
6+
# CREATE TEMPORARY...SELECT is GTID consistent since it cannot
7+
# generate row events, since temporary DML is never logged in row
8+
# format.
9+
10+
CREATE TABLE empty_innodb (a INT) ENGINE = InnoDB;
11+
CREATE TABLE empty_myisam (a INT) ENGINE = MyISAM;
12+
CREATE TABLE nonempty_innodb (a INT) ENGINE = InnoDB;
13+
CREATE TABLE nonempty_myisam (a INT) ENGINE = MyISAM;
14+
INSERT INTO nonempty_innodb VALUES (1);
15+
INSERT INTO nonempty_myisam VALUES (1);
16+
17+
--echo ---- CREATE TEMPORARY ... SELECT (value, 1 row) ----
18+
--let $statement= CREATE TEMPORARY TABLE t1 (a INT) SELECT 1
19+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
20+
DROP TABLE IF EXISTS t1;
21+
22+
--echo ---- CREATE TEMPORARY ... SELECT (InnoDB, 1 row) ----
23+
--let $statement= CREATE TEMPORARY TABLE t1 (a INT) SELECT * FROM nonempty_innodb
24+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
25+
DROP TABLE IF EXISTS t1;
26+
27+
--echo ---- CREATE TEMPORARY ... SELECT (MyISAM, 1 row) ----
28+
--let $statement= CREATE TEMPORARY TABLE t1 (a INT) SELECT * FROM nonempty_myisam
29+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
30+
DROP TABLE IF EXISTS t1;
31+
32+
--echo ---- CREATE TEMPORARY ... SELECT (InnoDB, 0 row) ----
33+
--let $statement= CREATE TEMPORARY TABLE t1 (a INT) SELECT * FROM empty_innodb
34+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
35+
DROP TABLE IF EXISTS t1;
36+
37+
--echo ---- CREATE TEMPORARY ... SELECT (MyISAM, 0 row) ----
38+
--let $statement= CREATE TEMPORARY TABLE t1 (a INT) SELECT * FROM empty_myisam
39+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
40+
DROP TABLE IF EXISTS t1;
41+
42+
# When SQL_LOG_BIN=0, it is GTID-consistent since nothing is logged.
43+
SET SQL_LOG_BIN = 0;
44+
45+
--echo ---- CREATE ... SELECT, SQL_LOG_BIN=0 (value, 1 row) ----
46+
--let $statement= CREATE TABLE t1 (a INT) SELECT 1
47+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
48+
DROP TABLE IF EXISTS t1;
49+
50+
--echo ---- CREATE ... SELECT, SQL_LOG_BIN=0 (InnoDB, 1 row) ----
51+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_innodb
52+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
53+
DROP TABLE IF EXISTS t1;
54+
55+
--echo ---- CREATE ... SELECT, SQL_LOG_BIN=0 (MyISAM, 1 row) ----
56+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_myisam
57+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
58+
DROP TABLE IF EXISTS t1;
59+
60+
--echo ---- CREATE ... SELECT, SQL_LOG_BIN=0 (InnoDB, 0 row) ----
61+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_innodb
62+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
63+
DROP TABLE IF EXISTS t1;
64+
65+
--echo ---- CREATE ... SELECT, SQL_LOG_BIN=0 (MyISAM, 0 row) ----
66+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_myisam
67+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
68+
DROP TABLE IF EXISTS t1;
69+
70+
DROP TABLE empty_innodb, empty_myisam, nonempty_innodb, nonempty_myisam;
71+
72+
SET SQL_LOG_BIN = 1;
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
--let $gtid_violation= 1
2+
--let $error_code= ER_GTID_UNSAFE_CREATE_SELECT
3+
--let $error_message= Statement violates GTID consistency: CREATE TABLE ... SELECT.
4+
--let $statement_ends_transaction= 1
5+
--let $sync_point= before_execute_sql_command
6+
7+
CREATE TABLE t0 (a INT) ENGINE = InnoDB;
8+
CREATE TABLE empty_innodb (a INT) ENGINE = InnoDB;
9+
CREATE TABLE empty_myisam (a INT) ENGINE = MyISAM;
10+
CREATE TABLE nonempty_innodb (a INT) ENGINE = InnoDB;
11+
CREATE TABLE nonempty_myisam (a INT) ENGINE = MyISAM;
12+
INSERT INTO nonempty_innodb VALUES (1);
13+
INSERT INTO nonempty_myisam VALUES (1);
14+
15+
# CREATE...SELECT for base table is not allowed, regardless of engine,
16+
# since it may get logged as CREATE followed by BEGIN; rows; COMMIT
17+
# (on this server if binlog_format=row or on a slave that uses
18+
# binlog_format=row).
19+
#
20+
# There is a corner case in the server code when 0 rows are selected,
21+
# so we test that too.
22+
23+
--echo ---- CREATE ... SELECT (value, 1 row) ----
24+
--let $statement= CREATE TABLE t1 (a INT) SELECT 1
25+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
26+
DROP TABLE IF EXISTS t1;
27+
28+
--echo ---- CREATE ... SELECT (InnoDB, 1 row) ----
29+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_innodb
30+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
31+
DROP TABLE IF EXISTS t1;
32+
33+
--echo ---- CREATE ... SELECT (MyISAM, 1 row) ----
34+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_myisam
35+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
36+
DROP TABLE IF EXISTS t1;
37+
38+
--echo ---- CREATE ... SELECT (InnoDB, 0 row) ----
39+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_innodb
40+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
41+
DROP TABLE IF EXISTS t1;
42+
43+
--echo ---- CREATE ... SELECT (MyISAM, 0 row) ----
44+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_myisam
45+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
46+
DROP TABLE IF EXISTS t1;
47+
48+
--echo ---- CREATE ... SELECT (value, 1 row, ongoing trx) ----
49+
--let $pre_statement= BEGIN; INSERT INTO t0 VALUES (1);
50+
--let $statement= CREATE TABLE t1 (a INT) SELECT 1
51+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
52+
DROP TABLE IF EXISTS t1;
53+
54+
--echo ---- CREATE ... SELECT (InnoDB, 1 row, ongoing trx) ----
55+
--let $pre_statement= BEGIN; INSERT INTO t0 VALUES (1);
56+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_innodb
57+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
58+
DROP TABLE IF EXISTS t1;
59+
60+
--echo ---- CREATE ... SELECT (MyISAM, 1 row, ongoing trx) ----
61+
--let $pre_statement= BEGIN; INSERT INTO t0 VALUES (1);
62+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM nonempty_myisam
63+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
64+
DROP TABLE IF EXISTS t1;
65+
66+
--echo ---- CREATE ... SELECT (InnoDB, 0 row, ongoing trx) ----
67+
--let $pre_statement= BEGIN; INSERT INTO t0 VALUES (1);
68+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_innodb
69+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
70+
DROP TABLE IF EXISTS t1;
71+
72+
--echo ---- CREATE ... SELECT (MyISAM, 0 row, ongoing trx) ----
73+
--let $pre_statement= BEGIN; INSERT INTO t0 VALUES (1);
74+
--let $statement= CREATE TABLE t1 (a INT) SELECT * FROM empty_myisam
75+
--source extra/binlog_tests/enforce_gtid_consistency_statement.inc
76+
DROP TABLE IF EXISTS t1;
77+
78+
DROP TABLE empty_myisam, empty_innodb, nonempty_myisam, nonempty_innodb, t0;

0 commit comments

Comments
 (0)