Debian Codegraph @

mysql-test/suite/binlog/r/binlog_mysqlbinlog_warn_stop_datetime.result

raw
1 SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-01 10:20:30.123456');
2 #
3 # Clear the existing binary log state, and start fresh using
4 # the timestamp variable set above
5 #
6 RESET MASTER;
7 create table t1 (a int);
8 insert into t1 values (1);
9 SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-02 10:20:30.123456');
10 insert into t1 values (2);
11 SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-03 10:20:30.123456');
12 flush binary logs;
13 SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-04 10:20:30.123456');
14 insert into t1 values (3);
15 insert into t1 values (4);
16 SET TIMESTAMP= UNIX_TIMESTAMP('2024-12-05 10:20:30.123456');
17 insert into t1 values (5);
18 insert into t1 values (6);
19 insert into t1 values (7);
20 SET TIMESTAMP=UNIX_TIMESTAMP('2024-12-06 10:20:30.123456');
21 flush binary logs;
22 drop table t1;
23 # Ensuring binary log order is correct
24 #
25 #
26 # Test using --read-from-remote-server
27 #
28 connection default;
29 #
30 # --stop-datetime tests
31 # Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
32 # 2.a, 2.b, and 2.c.
33 #
34 # Case 1.a) With one binlog file, a --stop-datetime before the end of
35 # the file should not result in a warning
36 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
37 #
38 # Case 1.b) With one binlog file, a --stop-datetime at the end of the
39 # file should not result in a warning
40 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
41 #
42 # Case 1.c) With one binlog file, a --stop-datetime beyond the end of
43 # the file should(!) result in a warning
44 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
45 WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
46 #
47 # Case 2.a) With two binlog files, a --stop-datetime within the
48 # timespan of binlog 2 should:
49 # 1) not provide any warnings
50 # 2) not prevent binlog 1 or 2 from outputting the desired events
51 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
52 include/assert_grep.inc [Ensure all intended GTIDs are present]
53 include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
54 #
55 # Case 2.b) With two binlog files, a --stop-datetime at the end of
56 # binlog 2 should:
57 # 1) not provide any warnings
58 # 2) not prevent binlog 1 or 2 from outputting all events
59 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
60 include/assert_grep.inc [Ensure a GTID exists for each transaction]
61 #
62 # Case 2.c) With two binlog files, a --stop-datetime beyond the end of
63 # binlog 2 should:
64 # 1) provide a warning that the stop datetime was not reached
65 # 2) not prevent binlog 1 or 2 from outputting all events
66 # MYSQL_BINLOG --read-from-remote-server --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
67 WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
68 include/assert_grep.inc [Ensure a GTID exists for each transaction]
69 #
70 #
71 # Test using local binlog files
72 #
73 connection default;
74 #
75 # --stop-datetime tests
76 # Note: MDEV-35528 reported that mysqlbinlog would fail on tests cases
77 # 2.a, 2.b, and 2.c.
78 #
79 # Case 1.a) With one binlog file, a --stop-datetime before the end of
80 # the file should not result in a warning
81 # MYSQL_BINLOG --stop-datetime='2024-12-02 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
82 #
83 # Case 1.b) With one binlog file, a --stop-datetime at the end of the
84 # file should not result in a warning
85 # MYSQL_BINLOG --stop-datetime='2024-12-03 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
86 #
87 # Case 1.c) With one binlog file, a --stop-datetime beyond the end of
88 # the file should(!) result in a warning
89 # MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full --result-file=tmp/warn_datetime_test_file.out 2>&1
90 WARNING: Did not reach stop datetime '2024-12-04 10:20:30.123456' before end of input
91 #
92 # Case 2.a) With two binlog files, a --stop-datetime within the
93 # timespan of binlog 2 should:
94 # 1) not provide any warnings
95 # 2) not prevent binlog 1 or 2 from outputting the desired events
96 # MYSQL_BINLOG --stop-datetime='2024-12-04 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
97 include/assert_grep.inc [Ensure all intended GTIDs are present]
98 include/assert_grep.inc [Ensure the next GTID binlogged is _not_ present]
99 #
100 # Case 2.b) With two binlog files, a --stop-datetime at the end of
101 # binlog 2 should:
102 # 1) not provide any warnings
103 # 2) not prevent binlog 1 or 2 from outputting all events
104 # MYSQL_BINLOG --stop-datetime='2024-12-06 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
105 include/assert_grep.inc [Ensure a GTID exists for each transaction]
106 #
107 # Case 2.c) With two binlog files, a --stop-datetime beyond the end of
108 # binlog 2 should:
109 # 1) provide a warning that the stop datetime was not reached
110 # 2) not prevent binlog 1 or 2 from outputting all events
111 # MYSQL_BINLOG --stop-datetime='2024-12-07 10:20:30.123456' binlog_f1_full binlog_f2_full --result-file=tmp/warn_datetime_test_file.out 2>&1
112 WARNING: Did not reach stop datetime '2024-12-07 10:20:30.123456' before end of input
113 include/assert_grep.inc [Ensure a GTID exists for each transaction]
114 #
115 # End of binlog_mysqlbinlog_warn_stop_datetime.test