~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/mysqlbinlog2.test

  • Committer: Monty Taylor
  • Date: 2008-10-20 08:48:34 UTC
  • mfrom: (520.1.22 drizzle)
  • Revision ID: monty@inaugust.com-20081020084834-xpb3w01vkcp55o02
Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Test for the new options --start-datetime, stop-datetime,
2
 
# and a few others.
3
 
 
4
 
# TODO: Need to look at making row based version once new binlog client is complete.
5
 
 
6
 
 
7
 
--disable_warnings
8
 
drop table if exists t1;
9
 
--enable_warnings
10
 
reset master;
11
 
 
12
 
# We need this for getting fixed timestamps inside of this test.
13
 
# I use a date in the future to keep a growing timestamp along the
14
 
# binlog (including the Start_log_event). This test will work 
15
 
# unchanged everywhere, because mysql-test-run has fixed TZ, which it
16
 
# exports (so mysqlbinlog has same fixed TZ).
17
 
set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22");
18
 
set timestamp=@a;
19
 
create table t1 (a int auto_increment not null primary key, b char(3));
20
 
insert into t1 values(null, "a");
21
 
insert into t1 values(null, "b");
22
 
set timestamp=@a+2;
23
 
insert into t1 values(null, "c");
24
 
set timestamp=@a+4;
25
 
insert into t1 values(null, "d");
26
 
insert into t1 values(null, "e");
27
 
 
28
 
flush logs;
29
 
set timestamp=@a+1; # this could happen on a slave
30
 
insert into t1 values(null, "f");
31
 
 
32
 
# delimiters are for easier debugging in future
33
 
 
34
 
--disable_query_log
35
 
select "--- Local --" as "";
36
 
--enable_query_log
37
 
 
38
 
#
39
 
# We should use --short-form everywhere because in other case output will
40
 
# be time dependent (the Start events). Better than nothing.
41
 
#
42
 
 
43
 
--exec $DRIZZLE_BINLOG --short-form --base64-output=never $MYSQLTEST_VARDIR/log/master-bin.000001 
44
 
 
45
 
--disable_query_log
46
 
select "--- offset --" as "";
47
 
--enable_query_log
48
 
--exec $DRIZZLE_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 
49
 
--disable_query_log
50
 
select "--- start-position --" as "";
51
 
--enable_query_log
52
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 $MYSQLTEST_VARDIR/log/master-bin.000001 
53
 
--disable_query_log
54
 
select "--- stop-position --" as "";
55
 
--enable_query_log
56
 
--exec $DRIZZLE_BINLOG --short-form --stop-position=609 $MYSQLTEST_VARDIR/log/master-bin.000001 
57
 
--disable_query_log
58
 
select "--- start and stop positions ---" as "";
59
 
--enable_query_log
60
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 --stop-position 726 $MYSQLTEST_VARDIR/log/master-bin.000001 
61
 
--disable_query_log
62
 
select "--- start-datetime --" as "";
63
 
--enable_query_log
64
 
--exec $DRIZZLE_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 
65
 
--disable_query_log
66
 
select "--- stop-datetime --" as "";
67
 
--enable_query_log
68
 
--exec $DRIZZLE_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 
69
 
 
70
 
--disable_query_log
71
 
select "--- Local with 2 binlogs on command line --" as "";
72
 
--enable_query_log
73
 
 
74
 
# This is to verify that some options apply only to first, or last binlog
75
 
 
76
 
flush logs;
77
 
--exec $DRIZZLE_BINLOG --short-form $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
78
 
 
79
 
--disable_query_log
80
 
select "--- offset --" as "";
81
 
--enable_query_log
82
 
--exec $DRIZZLE_BINLOG --short-form --offset=2 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
83
 
--disable_query_log
84
 
select "--- start-position --" as "";
85
 
--enable_query_log
86
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
87
 
--disable_query_log
88
 
select "--- stop-position --" as "";
89
 
--enable_query_log
90
 
--exec $DRIZZLE_BINLOG --short-form --stop-position=135 $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
91
 
--disable_query_log
92
 
select "--- start-datetime --" as "";
93
 
--enable_query_log
94
 
--exec $DRIZZLE_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
95
 
--disable_query_log
96
 
select "--- stop-datetime --" as "";
97
 
--enable_query_log
98
 
--exec $DRIZZLE_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLTEST_VARDIR/log/master-bin.000001 $MYSQLTEST_VARDIR/log/master-bin.000002
99
 
 
100
 
--disable_query_log
101
 
select "--- Remote --" as "";
102
 
--enable_query_log
103
 
 
104
 
--exec $DRIZZLE_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
105
 
 
106
 
--disable_query_log
107
 
select "--- offset --" as "";
108
 
--enable_query_log
109
 
--exec $DRIZZLE_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
110
 
--disable_query_log
111
 
select "--- start-position --" as "";
112
 
--enable_query_log
113
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
114
 
--disable_query_log
115
 
select "--- stop-position --" as "";
116
 
--enable_query_log
117
 
--exec $DRIZZLE_BINLOG --short-form --stop-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
118
 
--disable_query_log
119
 
select "--- start and stop positions ---" as "";
120
 
--enable_query_log
121
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 --stop-position 726 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
122
 
--disable_query_log
123
 
select "--- start-datetime --" as "";
124
 
--enable_query_log
125
 
--exec $DRIZZLE_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
126
 
--disable_query_log
127
 
select "--- stop-datetime --" as "";
128
 
--enable_query_log
129
 
--exec $DRIZZLE_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
130
 
 
131
 
--disable_query_log
132
 
select "--- Remote with 2 binlogs on command line --" as "";
133
 
--enable_query_log
134
 
 
135
 
--exec $DRIZZLE_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
136
 
 
137
 
--disable_query_log
138
 
select "--- offset --" as "";
139
 
--enable_query_log
140
 
--exec $DRIZZLE_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001  master-bin.000002
141
 
--disable_query_log
142
 
select "--- start-position --" as "";
143
 
--enable_query_log
144
 
--exec $DRIZZLE_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001  master-bin.000002
145
 
--disable_query_log
146
 
select "--- stop-position --" as "";
147
 
--enable_query_log
148
 
--exec $DRIZZLE_BINLOG --short-form --stop-position=135 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001  master-bin.000002
149
 
--disable_query_log
150
 
select "--- start-datetime --" as "";
151
 
--enable_query_log
152
 
--exec $DRIZZLE_BINLOG --short-form "--start-datetime=20200121153224" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
153
 
--disable_query_log
154
 
select "--- stop-datetime --" as "";
155
 
--enable_query_log
156
 
--exec $DRIZZLE_BINLOG --short-form "--stop-datetime=2020/01/21 15@32@24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
157
 
 
158
 
--disable_query_log
159
 
select "--- to-last-log --" as "";
160
 
--enable_query_log
161
 
 
162
 
--exec $DRIZZLE_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --to-last-log master-bin.000001
163
 
 
164
 
# clean up
165
 
--disable_query_log
166
 
select "--- end of test --" as "";
167
 
--enable_query_log
168
 
drop table t1;
169
 
 
170
 
# End of 4.1 tests