3 # Auxiliary file used in include/show_binlog_events.inc and
4 # include/show_relaylog_events.inc.
8 # See include/show_binlog_events.inc
10 --let $include_filename= show_events.inc
11 --source include/begin_include_file.inc
15 # If $binlog_start is not set, we will set it as the second event's
16 # position. The first event(Description Event) is always ignored. For
17 # description event's length might be changed because of adding new events,
18 # 'SHOW BINLOG EVENTS LIMIT 1' is used to get the right value.
19 --let $binlog_start= query_get_value(SHOW BINLOG EVENTS LIMIT 1, End_log_pos, 1)
22 --let $_se_old_statement= $statement
24 --let $statement=show BINLOG events
27 --let $statement=show relaylog events
32 --let $_binlog_file= $binlog_file
33 if ($binlog_file ==
'LAST')
37 --let $_binlog_file= query_get_value(SHOW SLAVE
STATUS, Relay_Log_File, 1)
41 --let $_binlog_file= query_get_value(SHOW MASTER
STATUS, File, 1)
44 --let $statement= $statement in
'$_binlog_file'
47 --let $statement= $statement from $binlog_start
49 if ($binlog_limit !=
'')
51 --let $statement= $statement
limit $binlog_limit
54 # Execute the statement and write to $output_file
55 --let $output_file= GENERATE
56 --source include/write_result_to_file.inc
58 # Filter the file through the following script.
61 # todo: use select_columns instead (requires updating all result files)
62 s{([^\t]*\t)[^\t]*(\t[^\t]*\t)[^\t]*\t[^\t]*(\t[^\t]*)}{DOLLAR1#DOLLAR2#\t#DOLLAR3};
63 s{/\* xid=.* \*/}{/\*
XID \*/};
64 s{table_id: [0-9]+}{table_id: #};
65 s{file_id=[0-9]+}{file_id=#};
66 s{block_len=[0-9]+}{block_len=#};
67 s{Server ver:.*DOLLAR}{SERVER_VERSION, BINLOG_VERSION};
68 s{SQL_LOAD-[a-z,0-9,-]*.[a-z]*}{SQL_LOAD-<SERVER UUID>-<MASTER server-
id>-<
file-
id>.<extension>};
69 s{rand_seed1=[0-9]*,rand_seed2=[0-9]*}{rand_seed1=<seed 1>,rand_seed2=<seed 2>};
70 s{((?:master|slave|slave-relay)-bin\.[0-9]{6};pos=)[0-9]+DOLLAR}{DOLLAR1POS};
71 s{SONAME
".*"}{SONAME
"LIB"};
72 s{DOLLARmysqltest_vardir}{MYSQLTEST_VARDIR}g;
74 --let $pre_script= my DOLLARmysqltest_vardir = DOLLARENV{
'MYSQLTEST_VARDIR'};
75 if (!$keep_gtid_events)
77 --let $script= $script DOLLAR_ =
'' if (m{\t(?:
Gtid|Previous_gtids)\t});
79 if ($keep_gtid_events)
81 let $pre_script= $pre_script
82 my DOLLARuuid_regex =
'[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}';
83 my DOLLARuuid_sidno_regex = DOLLARuuid_regex.
'(?::[0-9]+(?:-[0-9]+)?)+';
85 --let $script= $script s{DOLLARuuid_sidno_regex(?:,DOLLARuuid_sidno_regex)*}{
Gtid_set};
89 #--let $select_columns= 1 3 6
90 --let $input_file= $output_file
91 --source include/filter_file.inc
93 # Write to result file
94 --cat_file $output_file
97 --remove_file $output_file
99 --let $statement= $_se_old_statement
101 --let $include_filename= show_events.inc
102 --source include/end_include_file.inc