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--let $mysqlbinlog_parameters= --short-form $options $extra_options
43--source include/mysqlbinlog.inc
44