Debian Codegraph @

mysql-test/suite/ndb_binlog/t/ndb_binlog_manual_apply.test

raw
1 -- source include/have_ndb.inc
2 -- source include/have_binlog_format_row.inc
3
4 # Let's create some Binlog
5
6 show variables like '%binlog_format%';
7
8 use test;
9 create table test.t1 (a int primary key, b int) engine=myisam;
10 create table test.notes (a varchar(1000)) engine=myisam;
11 reset master;
12
13 # Autocommit, transaction per statement
14
15 insert into test.notes values ("Scattered single statement transactions");
16 insert into test.t1 values (1,1);
17 insert into test.t1 values (2,2);
18 update test.t1 set b=20 where a=2;
19 delete from test.t1 where a=1;
20
21 insert into test.notes values ("Some composite transactions, starting with diff ops");
22 begin;
23 insert into t1 values (10,10);
24 update t1 set b=11 where a=10;
25 commit;
26
27 begin;
28 update t1 set b=20 where a=10;
29 insert into t1 values (21,21);
30 commit;
31
32 begin;
33 delete from t1 where a=10;
34 update t1 set b=22 where a=21;
35 commit;
36
37 insert into test.notes values ("Some composite transactions with multiple ops");
38 begin;
39 insert into t1 values (30,30);
40 insert into t1 values (31,31);
41 insert into t1 values (32,32);
42 insert into t1 values (33,33);
43 insert into t1 values (34,34);
44 insert into t1 values (35,35);
45 insert into t1 values (36,36);
46 insert into t1 values (37,37);
47 insert into t1 values (38,38);
48 insert into t1 values (39,39);
49 commit;
50
51 begin;
52 update t1 set b=b+10 where a >= 30;
53 commit;
54
55 begin;
56 delete from t1 where a >= 30;
57 commit;
58
59 flush logs;
60
61 drop table test.t1;
62 drop table test.notes;
63
64 create table test.t1 (a int primary key, b int) engine=ndb;
65 create table test.notes (a varchar(1000)) engine=ndb;
66
67 let $MYSQLD_DATADIR= `select @@datadir;`;
68 --exec $MYSQL_BINLOG $MYSQLD_DATADIR/binlog.000001 > $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
69 --exec $MYSQL -uroot < $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql
70
71 --sorted_result
72 select * from test.t1;
73
74 drop table test.t1;
75 drop table test.notes;
76 --remove_file $MYSQLTEST_VARDIR/tmp/ndb_binlog_mysqlbinlog.sql