1# ==== Purpose ==== 2# 3# Auxiliary file used by include/mysqlbinlog_start_stop_1.inc 4# 5# This prints a header, then runs mysqlbinlog once with given parameters. 6# 7# ==== Usage ==== 8# 9# --let $extra_options= X 10# --let $options= Y 11# --source include/mysqlbinlog-start-stop-2.inc 12# 13# Parameters: 14# 15# $extra_options 16# Options that will be passed to mysqlbinlog but not printed to the test log 17# 18# $options 19# Options that will be printed as a header in the test log. 20 21 22# Pretty-print $option_text 23--let $option_text= `SELECT REPLACE('$options', '"', '')` 24--let $eq_pos= `SELECT LOCATE('=', '$option_text')` 25while ($eq_pos != 0) 26{ 27 --let $dash_pos= `SELECT LOCATE('--', '$option_text', $eq_pos)` 28 --let $left_part= `SELECT SUBSTR('$option_text', 1, $eq_pos - 1)` 29 --let $right_part= 30 if ($dash_pos != 0) { 31 --let $right_part= `SELECT CONCAT(' ', SUBSTR('$option_text', $dash_pos + 2))` 32 } 33 --let $option_text= $left_part$right_part 34 --let $eq_pos= `SELECT LOCATE('=', '$option_text')` 35} 36--let $option_text= `SELECT REPLACE('$option_text', '--', '')` 37 38--echo 39--echo ---- $option_text ---- 40 41# Print output 42--replace_regex /SET @@SESSION.GTID_NEXT= '.*'/SET @@SESSION.GTID_NEXT= 'GTID'/ /([0-9A-Fa-f\-]{36})\:[0-9]+\-[0-9]+/UUID:#-#/ 43--exec $MYSQL_BINLOG --short-form $options $extra_options 44