Debian Codegraph @

mysql-test/suite/binlog/t/binlog_mysqlbinlog_require_row_format_output.test

raw
1 # ==== Purpose ====
2 #
3 # This test evaluates the output of mysqlbinlog with --require_row_format
4 #
5 # ==== Requirements ====
6 #
7 # When using --require_row_format mysqlbinlog shall
8 #
9 # T1. SET @@session.require_row_format = 1 is printed on the start
10 # T2. SET @@session.pseudo_thread_id is omitted for query events
11 #
12 # ==== Implementation ====
13 #
14 # 1. Add some data to be present in the binlog and flush it.
15 # 2. Execute mysqlbinlog without --require_row_format
16 # @@SESSION.REQUIRE_ROW_FORMAT is not set
17 # @@session.pseudo_thread_id is set
18 # 3. Execute mysqlbinlog with --require_row_format
19 # @@SESSION.REQUIRE_ROW_FORMAT is set
20 # @@session.pseudo_thread_id is not set
21 # 4. Cleanup
22 #
23 # ==== Related Worklog ====
24 #
25 # WL #12968 : Configure replication applier to require row-based replication
26
27 -- source include/have_binlog_format_row.inc
28
29 # Reset the binlog to avoid interference from other tests
30 RESET MASTER;
31
32 --echo #
33 --echo # 1. Add some data to be present in the binlog and flush it.
34
35 CREATE TABLE t1 (c01 BIT);
36 INSERT INTO t1 VALUES (0);
37 INSERT INTO t1 VALUES (1);
38
39 DROP TABLE t1;
40
41 FLUSH LOGS;
42
43 --echo #
44 --echo # 2. Execute mysqlbinlog without --require_row_format
45 --echo # @@SESSION.REQUIRE_ROW_FORMAT is not set
46 --echo # @@session.pseudo_thread_id is set
47
48 --let $MYSQLD_DATADIR= `select @@datadir`
49 --let $mysqlbinlog_parameters= $MYSQLD_DATADIR/binlog.000001
50 --let $mysqlbinlog_pipe= > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
51 --source include/mysqlbinlog.inc
52
53 --let $assert_text = There is no session.require_row_format being set
54 --let $assert_file = $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
55 --let $assert_select = @@SESSION.REQUIRE_ROW_FORMAT
56 --let $assert_count = 0
57 --source include/assert_grep.inc
58
59 --let $assert_text = There are occurrences of session.pseudo_thread_id being set
60 --let $assert_file = $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
61 --let $assert_select = @@session.pseudo_thread_id
62 --let $assert_count = 1
63 --source include/assert_grep.inc
64
65 --echo #
66 --echo # 3. Execute mysqlbinlog with --require_row_format
67 --echo # @@SESSION.REQUIRE_ROW_FORMAT is set
68 --echo # @@session.pseudo_thread_id is not set
69
70 let $MYSQLD_DATADIR= `select @@datadir`;
71 --let $mysqlbinlog_parameters= --require_row_format $MYSQLD_DATADIR/binlog.000001
72 --let $mysqlbinlog_pipe= > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
73 --source include/mysqlbinlog.inc
74
75 --let $assert_text = Session.require_row_format is being set
76 --let $assert_file = $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
77 --let $assert_select = @@SESSION.REQUIRE_ROW_FORMAT
78 --let $assert_count = 1
79 --source include/assert_grep.inc
80
81 --let $assert_text = There are no occurrences of session.pseudo_thread_id being set
82 --let $assert_file = $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
83 --let $assert_select = @@session.pseudo_thread_id
84 --let $assert_count = 0
85 --source include/assert_grep.inc
86
87 --echo #
88 --echo # 4. Cleanup
89
90 --remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.out
91