summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_binlog_compress.test
blob: ef1e45084b686408e4c8da9bf2af56640737c453 (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
60
61
#
# Test of compressed binlog with replication
#

source include/master-slave.inc;

set @old_log_bin_compress=@@log_bin_compress;
set @old_log_bin_compress_min_len=@@log_bin_compress_min_len;
set @old_binlog_format=@@binlog_format;
set @old_binlog_row_image=@@binlog_row_image;

set global log_bin_compress=on;
set global log_bin_compress_min_len=10;

drop table if exists t1;
CREATE TABLE t1 (pr_id int(10) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, pr_page int(11) NOT NULL, pr_type varbinary(60) NOT NULL, test int, UNIQUE KEY pr_pagetype (pr_page,pr_type)) ENGINE=myisam AUTO_INCREMENT=136;

set binlog_format=statement;
insert into t1 (pr_page, pr_type, test) values(1,"one",0),(2,"two",0);
replace into t1 (pr_page, pr_type,test) values(1,"one",2);
update t1 set test=test+1 where pr_page > 1;
delete from t1 where test=1;

select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
connection master;


set binlog_format=row;
insert into t1 (pr_page, pr_type, test) values(3,"three",0),(4,"four",4),(5, "five", 0);
replace into t1 (pr_page, pr_type,test) values(3,"one",2);
update t1 set test=test+1 where pr_page > 3;
delete from t1 where test=1;

select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
connection master;


set binlog_row_image=minimal;
insert into t1 (pr_page, pr_type, test) values(6,"six",0),(7,"seven",7),(8, "eight", 0);
replace into t1 (pr_page, pr_type,test) values(6,"six",2);
update t1 set test=test+1 where pr_page > 6;
delete from t1 where test=1;

select * from t1;
sync_slave_with_master;
connection slave;
select * from t1;
connection master;
drop table t1;

set global log_bin_compress=@old_log_bin_compress;
set global log_bin_compress_min_len=@old_log_bin_compress_min_len;
set binlog_format=@old_binlog_format;
set binlog_row_image=@old_binlog_row_image;
--source include/rpl_end.inc