File: no_binlog_gtid_next_partially_failed_stmts_anonymous.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 (78 lines) | stat: -rw-r--r-- 2,498 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# ==== Purpose ====
#
# When binlog is disabled, verify that we can set GTID_NEXT
# to 'ANONYMOUS' after the partially failed statement
# consumed its 'ANONYMOUS' gtid.
#
# ==== Implementation ====
#
# 1) SET SESSION GTID_NEXT='UUID:GNO'.
# 2) When binlog is disabled, verify that we can set GTID_NEXT
#    to 'ANONYMOUS' after the partially failed statement
#    consumed its 'ANONYMOUS' gtid.
# 3) Execute above three steps for all different types of statements
#
# ==== References ====
#
# Bug#21686749  PARTIALLY FAILED DROP OR ACL STMT FAILS TO CONSUME GTID ON BINLOGLESS SLAVE
# See mysql-test/suite/binlog/t/binlog_gtid_next_partially_failed_stmts.test
# See mysql-test/suite/binlog/t/binlog_gtid_next_partially_failed_grant.test
# See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts.test
# See mysql-test/t/no_binlog_gtid_next_partially_failed_stmts_error.test
#

# Test requires MyISAM as storage engine
--source include/force_myisam_default.inc
--source include/have_myisam.inc

# Should be tested against "binlog disabled" server
--source include/not_log_bin.inc
# Requires debug server to simulate failure to drop table in SE
--source include/have_debug.inc

# Make sure the test is repeatable
RESET MASTER;
SET GTID_NEXT = 'ANONYMOUS';
CREATE TABLE t1 (a int) ENGINE=MyISAM;
SET GTID_NEXT = 'ANONYMOUS';
CREATE TABLE t2 (a int) ENGINE=InnoDB;

# Check-1: DROP TABLE
SET GTID_NEXT = 'ANONYMOUS';
--echo #
--echo # Make DROP TABLE statement to fail partially, by injecting error
--echo # after dropping MyISAM table.
--echo #
SET @@debug="+d,rm_table_no_locks_abort_before_atomic_tables";
--error ER_UNKNOWN_ERROR
DROP TABLE t1, t2;
SET @@debug="-d,rm_table_no_locks_abort_before_atomic_tables";
--echo #
--echo # The table t1 was dropped, which means DROP TABLE
--echo # can be failed partially.
--echo #
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE t1;
--echo #
--echo # When binlog is disabled, verify that we can set
--echo # GTID_NEXT to 'ANONYMOUS' after the partially failed
--echo # DROP TABLE statement consumed its 'ANONYMOUS' gtid.
--echo #
SET GTID_NEXT = 'ANONYMOUS';

CREATE USER u1@h;

# Check-2: DROP USER
SET GTID_NEXT = 'ANONYMOUS';
--error ER_CANNOT_USER
DROP USER u1@h, u2@h;
--echo #
--echo # When binlog is disabled, verify that we can set
--echo # GTID_NEXT to 'ANONYMOUS' after the failed DROP USER
--echo # statement  did not consumed its 'ANONYMOUS' gtid.
--echo #
SET GTID_NEXT = 'ANONYMOUS';

DROP USER u1@h;
SET GTID_NEXT = 'ANONYMOUS';
DROP TABLE t2;