4
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
5
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
6
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
10
use warnings FATAL => 'all';
11
use English qw(-no_match_vars);
12
use Test::More tests => 7;
17
my $p = new BinaryLogParser();
20
my $sample = "t/lib/samples/binlogs/";
24
file => $sample."binlog001.txt",
25
oktorun => sub { $oktorun = $_[0]; },
28
'@@session.character_set_client' => '8',
29
'@@session.collation_connection' => '8',
30
'@@session.collation_server' => '8',
31
'@@session.foreign_key_checks' => '1',
32
'@@session.sql_auto_is_null' => '1',
33
'@@session.sql_mode' => '0',
34
'@@session.time_zone' => '\'system\'',
35
'@@session.unique_checks' => '1',
36
Query_time => '20664',
37
Thread_id => '104168',
41
end_log_pos => '498006652',
43
offset => '498006722',
46
timestamp => '1197046970',
47
ts => '071207 12:02:50'
50
Query_time => '20675',
51
Thread_id => '104168',
52
arg => 'update test3.tblo as o
53
inner join test3.tbl2 as e on o.animal = e.animal and o.oid = e.oid
56
where e.tblo is null',
62
offset => '498006789',
65
timestamp => '1197046927',
66
ts => '071207 12:02:07'
69
Query_time => '20704',
70
Thread_id => '104168',
71
arg => 'replace into test4.tbl9(tbl5, day, todo, comment)
72
select distinct o.tbl5, date(o.col3), \'misc\', right(\'foo\', 50)
74
inner join test3.tbl2 as e on o.animal = e.animal and o.oid = e.oid
75
where e.tblo is not null
78
and o.col3 >= date_sub(current_date, interval 30 day)',
83
offset => '498007067',
86
timestamp => '1197046928',
87
ts => '071207 12:02:08'
90
Query_time => '20664',
91
Thread_id => '104168',
92
arg => 'update test3.tblo as o inner join test3.tbl2 as e
93
on o.animal = e.animal and o.oid = e.oid
96
where o.tbl2 is null',
99
end_log_pos => '1161',
101
offset => '498007625',
104
timestamp => '1197046970',
105
ts => '071207 12:02:50'
112
end_log_pos => '498007840',
113
offset => '498007950',
116
ts => '071207 12:02:50'
119
Query_time => '20661',
120
Thread_id => '103374',
121
arg => 'insert into test1.tbl6
122
(day, tbl5, misccol9type, misccol9, metric11, metric12, secs)
124
(convert_tz(current_timestamp,\'EST5EDT\',\'PST8PDT\'), \'239\', \'foo\', \'bar\', 1, \'1\', \'16.3574378490448\')
125
on duplicate key update metric11 = metric11 + 1,
126
metric12 = metric12 + values(metric12), secs = secs + values(secs)',
129
end_log_pos => '417',
131
offset => '498007977',
134
timestamp => '1197046973',
135
ts => '071207 12:02:53'
142
end_log_pos => '498008284',
143
offset => '498008394',
146
ts => '071207 12:02:53'
149
Query_time => '20661',
150
Thread_id => '103374',
151
arg => 'update test2.tbl8
152
set last2metric1 = last1metric1, last2time = last1time,
153
last1metric1 = last0metric1, last1time = last0time,
154
last0metric1 = ondeckmetric1, last0time = now()
155
where tbl8 in (10800712)',
158
end_log_pos => '314',
160
offset => '498008421',
163
timestamp => '1197046973',
164
ts => '071207 12:02:53'
171
end_log_pos => '498008625',
172
offset => '498008735',
175
ts => '071207 12:02:53'
178
arg => 'ROLLBACK /* added by mysqlbinlog */
179
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/',
196
file => $sample."binlog002.txt",
205
server_id => '12345',
206
ts => '090722 7:21:41'
209
'@@session.character_set_client' => '8',
210
'@@session.collation_connection' => '8',
211
'@@session.collation_server' => '8',
212
'@@session.foreign_key_checks' => '1',
213
'@@session.sql_auto_is_null' => '1',
214
'@@session.sql_mode' => '0',
215
'@@session.unique_checks' => '1',
218
arg => 'create database d',
221
end_log_pos => '175',
225
server_id => '12345',
226
timestamp => '1248268919',
227
ts => '090722 7:21:59'
232
arg => 'create table foo (i int)',
236
end_log_pos => '259',
240
server_id => '12345',
241
timestamp => '1248268936',
242
ts => '090722 7:22:16'
247
arg => 'insert foo values (1),(2)',
250
end_log_pos => '344',
254
server_id => '12345',
255
timestamp => '1248268944',
256
ts => '090722 7:22:24'
259
arg => 'ROLLBACK /* added by mysqlbinlog */
260
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/',
269
# #############################################################################
270
# Issue 606: Unknown event type Rotate at ./mk-slave-prefetch
271
# #############################################################################
274
file => $sample."binlog006.txt",
278
# #############################################################################
280
# #############################################################################