summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/rpl_statement.test
blob: cb5f5e04b007b907ecfa617178f11371a0ce111c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--source include/have_rocksdb.inc
source include/master-slave.inc;

source include/have_binlog_format_statement.inc;

connection master;
--disable_warnings
drop table if exists t1;
--enable_warnings

connection master;

select @@binlog_format;
create table t1 (pk int primary key) engine=rocksdb;
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
insert into t1 values (1),(2),(3);

set session rocksdb_unsafe_for_binlog=on;
insert into t1 values (1),(2),(3);
select * from t1;
delete from t1;
set session rocksdb_unsafe_for_binlog=off;

--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
insert into t1 values (1),(2),(3);

set binlog_format=row;
insert into t1 values (1),(2),(3);

--source include/sync_slave_sql_with_master.inc
connection slave;

select * from t1;

connection master;
drop table t1;

create table t1 (id int primary key, value int, value2 int, index(value)) engine=rocksdb; 
insert into t1 values (1,1,1); 
insert into t1 values (2,1,1); 
insert into t1 values (3,1,1); 
insert into t1 values (4,1,1); 
insert into t1 values (5,1,1); 
update t1 set value2=100 where id=1;
update t1 set value2=200 where id=2;
update t1 set value2=300 where id=3;

--source include/sync_slave_sql_with_master.inc
connection slave;
select * from t1 where id=1;
select * from t1 where id=2;
select * from t1 where id=3;

connection master;
drop table t1;
set binlog_format=row;

--source include/rpl_end.inc