File: binlog_mysqlbinlog_warn_stop_gtid.test

package info (click to toggle)
mariadb 1%3A11.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 772,520 kB
  • sloc: ansic: 2,414,714; cpp: 1,791,394; asm: 381,336; perl: 62,905; sh: 49,647; pascal: 40,897; java: 39,363; python: 20,791; yacc: 20,432; sql: 17,907; xml: 12,344; ruby: 8,544; cs: 6,542; makefile: 6,145; ada: 1,879; lex: 1,193; javascript: 996; objc: 80; tcl: 73; awk: 46; php: 22
file content (103 lines) | stat: -rw-r--r-- 3,497 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# Test ensures that --stop-position work correctly for mysqlbinlog. This high
# level test sets up the binary log (and tags certain locations for comparison),
# and the helper file binlog_mysqlbinlog_warn_stop_position.inc performs the
# actual tests.
#
# References:
#   MDEV-34614 mysqlbinlog warn on EOF before GTID in --stop-position
#
--source include/have_log_bin.inc

--let $binlog_out_relpath= tmp/warn_position_test_file.out
--let $binlog_out= $MYSQLTEST_VARDIR/$binlog_out_relpath

--echo #
--echo # Clear the existing binary log state.
--echo #
RESET MASTER;

SET @@SESSION.gtid_domain_id= 0;
SET @@SESSION.server_id= 1;
--let $binlog_f1= query_get_value(SHOW MASTER STATUS, File, 1)
SET @@SESSION.gtid_seq_no= 1;
create table t1 (a int);
insert into t1 values (1);
SET @@SESSION.gtid_domain_id= 1;
insert into t1 values (2);
--let $binlog_f1_pre_rotate= `SELECT @@GLOBAL.gtid_binlog_pos`
flush binary logs;
--let $binlog_f1_end= `SELECT @@GLOBAL.gtid_binlog_pos`

--let $binlog_f2= query_get_value(SHOW MASTER STATUS, File, 1)
insert into t1 values (3);
--echo # Tag binlog_f2_mid
--let $binlog_f2_mid= `SELECT @@GLOBAL.gtid_binlog_pos`
--let $binlog_f1_over_eof= $binlog_f2_mid
insert into t1 values (4);
--let $binlog_f2_gtid_after_midpoint= `SELECT @@GLOBAL.gtid_binlog_pos`
insert into t1 values (5);
SET @@SESSION.gtid_domain_id= 0;
insert into t1 values (6);
insert into t1 values (7);
--let $binlog_f2_last_gtid= `SELECT REGEXP_SUBSTR(@@GLOBAL.gtid_binlog_pos, '0-1-\\\\\\\\d++')`
flush binary logs;
--let $binlog_f2_end= `SELECT @@GLOBAL.gtid_binlog_pos`
drop table t1;
--let $binlog_f2_over_eof= `SELECT @@GLOBAL.gtid_binlog_pos`

--echo # Ensuring binary log order is correct
--let $binlog_f1_show= query_get_value(SHOW BINARY LOGS, Log_name, 1)
if (`SELECT strcmp('$binlog_f1','$binlog_f1_show') != 0`)
{
  --echo # Real binlog_f1: $binlog_f1
  --echo # First binlog in SHOW BINLOG FILES: $binlog_f1_show
  --die Wrong order of binary log files in SHOW BINARY LOGS
}
--let $binlog_f2_show= query_get_value(SHOW BINARY LOGS, Log_name, 2)
if (`SELECT strcmp('$binlog_f2','$binlog_f2_show') != 0`)
{
  --echo # Real binlog_f2: $binlog_f2
  --echo # First binlog in SHOW BINLOG FILES: $binlog_f2_show
  --die Wrong order of binary log files in SHOW BINARY LOGS
}

--let $domain_id= [01]

--echo #
--echo #
--echo # Test using --read-from-remote-server
--echo #
--let $read_from_remote_server= 1
--source binlog_mysqlbinlog_warn_stop_position.inc

--echo #
--echo #
--echo # Test using local binlog files
--echo #
--let $read_from_remote_server= 0
--source binlog_mysqlbinlog_warn_stop_position.inc

--echo # Poison GTID lists with an extraneous GTID domain - expect additional `9-1-1` warnings
--let $binlog_f1_pre_rotate= 9-1-1
--let $binlog_f2_mid=      $binlog_f1_pre_rotate,$binlog_f2_mid
--let $binlog_f1_end=      $binlog_f1_pre_rotate,$binlog_f1_end
--let $binlog_f2_end=      $binlog_f1_pre_rotate,$binlog_f2_end
--let $binlog_f1_over_eof= $binlog_f1_pre_rotate,$binlog_f1_over_eof
--let $binlog_f2_over_eof= $binlog_f1_pre_rotate,$binlog_f2_over_eof
--echo #
--echo #
--echo # Test extraneous stop GTID using --read-from-remote-server
--echo #
--let $read_from_remote_server= 1
--source binlog_mysqlbinlog_warn_stop_position.inc

--echo #
--echo #
--echo # Test extraneous stop GTID using local binlog files
--echo #
--let $read_from_remote_server= 0
--source binlog_mysqlbinlog_warn_stop_position.inc

--echo #
--echo # End of binlog_mysqlbinlog_warn_stop_gtid.test