2016-12-16 14:11:23 +03:00
|
|
|
include/master-slave.inc
|
|
|
|
[connection master]
|
|
|
|
connection slave;
|
|
|
|
connection master;
|
|
|
|
CREATE TABLE t1 (x int) with system versioning ENGINE = innodb;
|
|
|
|
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;
|
2016-12-18 17:06:43 +00:00
|
|
|
create or replace table t1 (x int primary key) engine = innodb;
|
|
|
|
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
|
|
|
|
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) engine = innodb;
|
|
|
|
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 primary key) with system versioning engine = innodb;
|
|
|
|
connection slave;
|
|
|
|
alter table t1 without system versioning;
|
|
|
|
connection master;
|
|
|
|
insert into t1 values (1);
|
|
|
|
update t1 set x= 2 where x = 1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
x
|
|
|
|
1
|
|
|
|
2
|
|
|
|
connection slave;
|
|
|
|
select * from t1;
|
|
|
|
x
|
|
|
|
2
|
|
|
|
connection master;
|
|
|
|
delete from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
x
|
|
|
|
1
|
|
|
|
2
|
|
|
|
connection slave;
|
|
|
|
select * from t1;
|
|
|
|
x
|
|
|
|
connection master;
|
2016-12-26 18:46:02 +03:00
|
|
|
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
|
|
|
|
2
|
|
|
|
1
|
|
|
|
connection slave;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
a
|
|
|
|
2
|
|
|
|
1
|
|
|
|
connection master;
|
2016-12-16 14:11:23 +03:00
|
|
|
drop table t1;
|
|
|
|
include/rpl_end.inc
|