mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
d28ef002d7
files NOTE: this is the backport to next-mr. SHOW BINLOG EVENTS does not work with relay log files. If issuing "SHOW BINLOG EVENTS IN 'relay-log.000001'" in a non-empty relay log file (relay-log.000001), mysql reports empty set. This patch addresses this issue by extending the SHOW command with RELAYLOG. Events in relay log files can now be inspected by issuing SHOW RELAYLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count].
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
# $binlog_start can be set by caller or take a default value
|
|
# $binary_log_file the name of the log file show
|
|
# $binary_log_limit_row - sets the number of binlog rows to be returned
|
|
# $binary_log_limit_offset - sets the offset where to start returning events
|
|
|
|
let $show_binlog_events= show relaylog events;
|
|
|
|
if (!$binlog_start)
|
|
{
|
|
# defaults to chop the first event in the binary log
|
|
let $binlog_start=106;
|
|
}
|
|
|
|
if (!`SELECT '$binary_log_file' = ''`)
|
|
{
|
|
let $show_binlog_events= $show_binlog_events in '$binary_log_file';
|
|
}
|
|
let $show_binlog_events= $show_binlog_events from $binlog_start;
|
|
|
|
if ($binary_log_limit_row)
|
|
{
|
|
let $limit= limit;
|
|
if ($binary_log_limit_offset)
|
|
{
|
|
let $limit= $limit $binary_log_limit_offset, ;
|
|
}
|
|
|
|
let $limit= $limit $binary_log_limit_row;
|
|
let $show_binlog_events= $show_binlog_events $limit;
|
|
}
|
|
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR $binlog_start <binlog_start>
|
|
--replace_column 2 # 4 # 5 #
|
|
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ /Server ver:.*$/SERVER_VERSION, BINLOG_VERSION/
|
|
--eval $show_binlog_events
|