Skip to content

Commit

Permalink
SQL: replication fixes [fixes #234]
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgs committed Jul 31, 2017
1 parent 88454b3 commit d998da0
Show file tree
Hide file tree
Showing 17 changed files with 300 additions and 126 deletions.
118 changes: 118 additions & 0 deletions mysql-test/suite/versioning/r/rpl_mixed.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
include/master-slave.inc
[connection master]
connection slave;
connection master;
CREATE TABLE t1 (x int) with system versioning;
insert into t1 values (1);
SELECT * FROM t1;
x
1
delete from t1;
select * from t1;
x
select * from t1 for system_time all;
x
1
connection slave;
select * from t1;
x
select * from t1 for system_time all;
x
1
connection master;
insert into t1 values (2);
connection slave;
select * from t1;
x
2
connection master;
update t1 set x = 3;
connection slave;
select * from t1;
x
3
select * from t1 for system_time all;
x
1
3
2
connection master;
create or replace table t1 (x int primary key);
connection slave;
alter table t1 with system versioning;
connection master;
insert into t1 values (1);
connection slave;
select * from t1;
x
1
select * from t1 for system_time all;
x
1
connection master;
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
x
2
select * from t1 for system_time all;
x
1
2
connection master;
delete from t1;
connection slave;
select * from t1;
x
select * from t1 for system_time all;
x
1
2
connection master;
create or replace table t1 (x int);
connection slave;
alter table t1 with system versioning;
connection master;
insert into t1 values (1);
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
x
2
select * from t1 for system_time all;
x
2
1
connection master;
delete from t1;
connection slave;
select * from t1;
x
select * from t1 for system_time all;
x
2
1
connection master;
create or replace table t1 (x int) with system versioning;
create or replace table t2 (x int) with system versioning;
insert into t1 values (1);
insert into t2 values (2);
update t1, t2 set t1.x=11, t2.x=22;
connection slave;
select * from t1;
x
11
select * from t2;
x
22
select * from t1 for system_time all;
x
11
1
select * from t2 for system_time all;
x
22
2
connection master;
drop table t1, t2;
include/rpl_end.inc
54 changes: 23 additions & 31 deletions mysql-test/suite/versioning/r/rpl_row.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
connection slave;
connection master;
CREATE TABLE t1 (x int) with system versioning ENGINE = innodb;
CREATE TABLE t1 (x int) with system versioning;
insert into t1 values (1);
SELECT * FROM t1;
x
Expand Down Expand Up @@ -37,11 +37,19 @@ x
3
2
connection master;
create or replace table t1 (x int primary key) engine = innodb;
create or replace table t1 (x int primary key);
connection slave;
alter table t1 with system versioning;
connection master;
insert into t1 values (1);
connection slave;
select * from t1;
x
1
select * from t1 for system_time all;
x
1
connection master;
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
Expand All @@ -61,7 +69,7 @@ x
1
2
connection master;
create or replace table t1 (x int) engine = innodb;
create or replace table t1 (x int);
connection slave;
alter table t1 with system versioning;
connection master;
Expand All @@ -85,42 +93,26 @@ x
2
1
connection master;
create or replace table t1 (x int primary key) with system versioning engine = innodb;
connection slave;
alter table t1 without system versioning;
connection master;
create or replace table t1 (x int) with system versioning;
create or replace table t2 (x int) with system versioning;
insert into t1 values (1);
update t1 set x= 2 where x = 1;
select * from t1 for system_time all;
x
1
2
insert into t2 values (2);
update t1, t2 set t1.x=11, t2.x=22;
connection slave;
select * from t1;
x
2
connection master;
delete from t1;
11
select * from t2;
x
22
select * from t1 for system_time all;
x
11
1
2
connection slave;
select * from t1;
select * from t2 for system_time all;
x
connection master;
create or replace table t1 (a int) with system versioning engine = innodb;
insert into t1 values (1);
update t1 set a=2;
select * from t1 for system_time all;
a
22
2
1
connection slave;
select * from t1 for system_time all;
a
2
1
connection master;
drop table t1;
drop table t1, t2;
include/rpl_end.inc
54 changes: 23 additions & 31 deletions mysql-test/suite/versioning/r/rpl_stmt.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
connection slave;
connection master;
CREATE TABLE t1 (x int) with system versioning ENGINE = innodb;
CREATE TABLE t1 (x int) with system versioning;
insert into t1 values (1);
SELECT * FROM t1;
x
Expand Down Expand Up @@ -37,11 +37,19 @@ x
3
2
connection master;
create or replace table t1 (x int primary key) engine = innodb;
create or replace table t1 (x int primary key);
connection slave;
alter table t1 with system versioning;
connection master;
insert into t1 values (1);
connection slave;
select * from t1;
x
1
select * from t1 for system_time all;
x
1
connection master;
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
Expand All @@ -61,7 +69,7 @@ x
1
2
connection master;
create or replace table t1 (x int) engine = innodb;
create or replace table t1 (x int);
connection slave;
alter table t1 with system versioning;
connection master;
Expand All @@ -85,42 +93,26 @@ x
2
1
connection master;
create or replace table t1 (x int primary key) with system versioning engine = innodb;
connection slave;
alter table t1 without system versioning;
connection master;
create or replace table t1 (x int) with system versioning;
create or replace table t2 (x int) with system versioning;
insert into t1 values (1);
update t1 set x= 2 where x = 1;
select * from t1 for system_time all;
x
1
2
insert into t2 values (2);
update t1, t2 set t1.x=11, t2.x=22;
connection slave;
select * from t1;
x
2
connection master;
delete from t1;
11
select * from t2;
x
22
select * from t1 for system_time all;
x
11
1
2
connection slave;
select * from t1;
select * from t2 for system_time all;
x
connection master;
create or replace table t1 (a int) with system versioning engine = innodb;
insert into t1 values (1);
update t1 set a=2;
select * from t1 for system_time all;
a
22
2
1
connection slave;
select * from t1 for system_time all;
a
2
1
connection master;
drop table t1;
drop table t1, t2;
include/rpl_end.inc
7 changes: 0 additions & 7 deletions mysql-test/suite/versioning/r/truncate_innodb_rpl.result

This file was deleted.

5 changes: 5 additions & 0 deletions mysql-test/suite/versioning/t/rpl_mixed.combinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[myisam]
default-storage-engine=myisam

[innodb]
default-storage-engine=innodb
7 changes: 7 additions & 0 deletions mysql-test/suite/versioning/t/rpl_mixed.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- source include/have_binlog_format_mixed.inc
-- source include/master-slave.inc
-- source include/have_innodb.inc

-- source rpl_test.inc

-- source include/rpl_end.inc
5 changes: 5 additions & 0 deletions mysql-test/suite/versioning/t/rpl_row.combinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[myisam]
default-storage-engine=myisam

[innodb]
default-storage-engine=innodb
5 changes: 5 additions & 0 deletions mysql-test/suite/versioning/t/rpl_stmt.combinations
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[innodb]
default-storage-engine=innodb

[myisam]
default-storage-engine=myisam
Loading

0 comments on commit d998da0

Please sign in to comment.