File: assert_rbr_only_flags.inc

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 (76 lines) | stat: -rw-r--r-- 2,521 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
# ==== Purpose ====
#
# Assert that the binary log contains a specific sequence of
# transactions according to the rbr_only flag.
#
# ==== Usage ====
#
# --let $binlog_file= FILENAME
# [--let $binlog_position= OFFSET]
# --let $rbr_only_flags= F1[,F2[,F3...]]
# [--let $save_binlog_position= 1]
# [--let $dont_print_rbr_only_flags= 1]
# --source include/assert_rbr_only_flags.inc
#
# Parameters:
#
#   $binlog_file
#     The binary log to look in.
#
#   $binlog_position
#     By default, this script starts reading from the beginning of the
#     binary log. Set this to start reading from some specific offset.
#
#   $rbr_only_flags
#     This is a comma-separated list of rbr_only flags. Each flag
#     consists of 'yes' or 'no'. Note that this is whitespace-sensitive.
#
#   $save_binlog_position
#     If this flag is set, the script will source
#     include/save_binlog_position.inc after it has finished the
#     assert, making the next invocation automatically continue where
#     this invocation ended.  This is convenient if the script is to
#     be called multiple times in a sequence.
#
#   $dont_print_rbr_only_flags
#     By default, $rbr_only_flags is printed to the result log. If
#     this flag is set, that is suppressed.

--let $include_filename= include/assert_rbr_only_flags.inc [$rbr_only_flags]
if ($dont_print_rbr_only_flags)
{
  --let $include_filename= include/assert_rbr_only_flags.inc
}
--source include/begin_include_file.inc


--let $assert_file= `SELECT CONCAT('$MYSQLTEST_VARDIR/tmp/_arof_', UUID())`

# Run mysqlbinlog.
--let $_arof_offset=
if ($binlog_position)
{
  --let $_arof_offset= --start-position=$binlog_position
}
--let $_arof_datadir= `SELECT @@datadir`
--exec $MYSQL_BINLOG --force-if-open $_arof_offset $_arof_datadir/$binlog_file > $assert_file

# Check for match.
--let $assert_select= rbr_only=.*
#--let $assert_match= `SELECT CONCAT('^[^\n]*last_committed=', REPLACE(REPLACE('$logical_timestamps', ';', '.*\n[^\n]*last_committed='), ' ', '\tsequence_number='))`
--let $assert_match= `SELECT CONCAT('^[^\n]*rbr_only=', REPLACE('$rbr_only_flags', ',', '.*\n[^\n]*rbr_only='))`
--let $assert_text= assert_gtid_rbr_only_flags: $rbr_only_flags
--let $extra_debug_info= Expected GTID rbr_only flags: $rbr_only_flags
--source include/assert_grep.inc

--remove_file $assert_file


if ($save_binlog_position)
{
  --source include/save_binlog_position.inc
}


--let $include_filename= include/assert_rbr_only_flags=.inc [$rbr_only_flags]
--source include/end_include_file.inc