1# ==== Purpose ====
2#
3# Test the --[start|stop]-[position|datetime] options to mysqlbinlog,
4# with/without --read-from-remote-server, with one or two binary logs
5# as input.
6#
7# ==== Implementation ====
8
9# TODO: Need to look at making row based version once new binlog client is complete.
10
11CREATE TABLE t1 (a INT);
12RESET MASTER;
13
14--source extra/binlog_tests/binlog_mysqlbinlog_fill.inc
15
16--let $MYSQLD_DATADIR= `select @@datadir`
17
18--echo
19--echo ==== Local ====
20
21--let $start_position= $pos_1
22--let $start_datetime= $datetime_1
23
24--let $stop_position= $pos_2
25--let $stop_datetime= $datetime_2
26--let $extra_options= $MYSQLD_DATADIR/$file_1
27--source extra/binlog_tests/mysqlbinlog_start_stop_1.inc
28
29--echo
30--echo ==== Local with 2 binlogs on command line ====
31# This is to verify that some options apply only to first, or last binlog
32
33--let $stop_position= $pos_3
34--let $stop_datetime= $datetime_3
35--let $extra_options= $MYSQLD_DATADIR/$file_1 $MYSQLD_DATADIR/$file_2
36--source extra/binlog_tests/mysqlbinlog_start_stop_1.inc
37
38--echo
39--echo ==== Remote ====
40
41--let $stop_position= $pos_2
42--let $stop_datetime= $datetime_2
43--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1
44--source extra/binlog_tests/mysqlbinlog_start_stop_1.inc
45
46--echo
47--echo ==== Remote with 2 binlogs on command line ====
48
49--let $stop_position= $pos_3
50--let $stop_datetime= $datetime_3
51--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1 $file_2
52--source extra/binlog_tests/mysqlbinlog_start_stop_1.inc
53
54
55# ==== to-last-log ====
56
57--let $extra_options= --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT $file_1
58--let $options= --to-last-log
59--source extra/binlog_tests/mysqlbinlog_start_stop_2.inc
60
61
62--echo
63--echo ==== clean up ====
64DROP TABLE t1;
65