~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
-- source include/have_binlog_format_row.inc
2
#
3
#  Write different events to binlog
4
#
5
create table t1 (a int);
6
insert into t1 values (1);
7
insert into t1 values (2);
8
insert into t1 values (3);
9
update t1 set a=a+2 where a=2;
10
update t1 set a=a+2 where a=3;
11
12
create table t2 (word varchar(20));
13
load data infile '../std_data_ln/words.dat' into table t2;
14
15
#
16
#  Save binlog
17
#
18
flush logs;
19
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
20
21
#
22
#  Clear database and restore from binlog
23
#
24
drop table t1;
25
drop table t2;
26
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
27
28
#
29
#  Verify that all binlog events have been executed
30
#
31
select * from t1;
32
select * from t2;
33
34
#
35
#  Verify that events larger than the default IO_CACHE buffer
36
#  are handled correctly (BUG#25628).
37
#
38
flush logs;
39
drop table t2;
40
create table t2 (word varchar(20));
41
load data infile '../std_data_ln/words.dat' into table t2;
42
insert into t2 select * from t2;
43
insert into t2 select * from t2;
44
insert into t2 select * from t2;
45
insert into t2 select * from t2;
46
insert into t2 select * from t2;
47
insert into t2 select * from t2;
48
insert into t2 select * from t2;
49
insert into t2 select * from t2;
50
insert into t2 select * from t2;
51
select count(*) from t2;
52
53
flush logs;
54
--exec $MYSQL_BINLOG --hexdump $MYSQLTEST_VARDIR/log/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
55
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
56
57
#
58
#  Verify that all binlog events have been executed
59
#
60
select count(*) from t2;
61
62
#
63
#  Test cleanup
64
#
65
--exec rm $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
66
drop table t1;
67
drop table t2;