File: no_binlog_gtid_empty_statement.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 (61 lines) | stat: -rw-r--r-- 1,985 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ==== Purpose ====
#
# This test will execute an empty statement before setting GTID_NEXT session
# variable. It will use both ANONYMOUS and specific GTIDs, with both GTID_MODE
# equal to OFF and ON.
#
# As an empty statement should be considered an "innocent" statement from the
# GTID execution point of view (it doesn't change the database), it should be
# possible to execute a SET GTID_NEXT right after the empty statement without
# errors.
#
# ==== Related Bugs and Worklogs ====
#
# BUG#22811150 SQLCOM_EMPTY_QUERY should be considered GTID innocent
#

# Should be tested against "binlog disabled" server
--source include/not_log_bin.inc

USE test;

# With anonymous GTIDs
--source include/set_gtid_next.inc
CREATE TABLE t1 (c1 INT);
# This statement should be considered an empty statement
/*!99999 SET @@SESSION.non_supported_session_variable = 1*/;
--source include/set_gtid_next.inc
INSERT INTO t1 VALUES (1);
# This statement should be considered an empty statement
/*!99999 SET @@SESSION.non_supported_session_variable = 1*/;
--source include/set_gtid_next.inc
DROP TABLE t1;

# Sets GTID_MODE to ON for the second part of the test
--let $rpl_gtid_mode= ON
--let $rpl_set_enforce_gtid_consistency= 1
--let $rpl_server_numbers= 1
--let $rpl_skip_sync= 1
--source include/rpl_set_gtid_mode.inc

# Just in case that the server has some GTID_EXECUTED
SET GTID_NEXT='AUTOMATIC';
RESET MASTER;

# With non-anonymous GTIDs
--source include/set_gtid_next.inc
CREATE TABLE t2 (c1 INT);
# This statement should be considered an empty statement
/*!99999 SET @@SESSION.non_supported_session_variable = 1*/;
--source include/set_gtid_next.inc
INSERT INTO t2 VALUES (1);
# This statement should be considered an empty statement
/*!99999 SET @@SESSION.non_supported_session_variable = 1*/;
--source include/set_gtid_next.inc
DROP TABLE t2;

# Cleanup
SET GTID_NEXT='AUTOMATIC';
--let $rpl_gtid_mode= OFF
--let $rpl_set_enforce_gtid_consistency= 0
--source include/rpl_set_gtid_mode.inc