2016-12-16 12:11:23 +01:00
|
|
|
#BUG#12662190 - COM_COMMIT IS NOT INCREMENTED FROM THE BINARY LOGS ON SLAVE, COM_BEGIN IS
|
|
|
|
#Testing command counters -BEFORE.
|
|
|
|
#Storing the before counts of Slave
|
|
|
|
connection slave;
|
|
|
|
let $slave_com_commit_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_commit', Value, 1);
|
|
|
|
let $slave_com_insert_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_insert', Value, 1);
|
|
|
|
let $slave_com_delete_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_delete', Value, 1);
|
|
|
|
let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_update', Value, 1);
|
|
|
|
|
|
|
|
connection master;
|
2017-07-31 10:42:48 +02:00
|
|
|
CREATE TABLE t1 (x int) with system versioning;
|
2016-12-16 12:11:23 +01:00
|
|
|
insert into t1 values (1);
|
|
|
|
SELECT * FROM t1;
|
|
|
|
delete from t1;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
insert into t1 values (2);
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
update t1 set x = 3;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
2016-12-18 18:06:43 +01:00
|
|
|
# check unversioned -> versioned replication
|
|
|
|
connection master;
|
2017-07-31 10:42:48 +02:00
|
|
|
create or replace table t1 (x int primary key);
|
2016-12-18 18:06:43 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
alter table t1 with system versioning;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
insert into t1 values (1);
|
2017-07-31 10:42:48 +02:00
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
|
|
|
connection master;
|
2016-12-18 18:06:43 +01:00
|
|
|
update t1 set x= 2 where x = 1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
delete from t1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
|
|
|
# same thing (UPDATE, DELETE), but without PK
|
|
|
|
connection master;
|
2017-07-31 10:42:48 +02:00
|
|
|
create or replace table t1 (x int);
|
2016-12-18 18:06:43 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
alter table t1 with system versioning;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
insert into t1 values (1);
|
|
|
|
update t1 set x= 2 where x = 1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
|
|
|
connection master;
|
|
|
|
delete from t1;
|
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
|
|
|
select * from t1 for system_time all;
|
|
|
|
|
2017-07-31 10:42:48 +02:00
|
|
|
# multi-update
|
2016-12-18 18:06:43 +01:00
|
|
|
connection master;
|
2017-07-31 10:42:48 +02:00
|
|
|
create or replace table t1 (x int) with system versioning;
|
|
|
|
create or replace table t2 (x int) with system versioning;
|
2016-12-18 18:06:43 +01:00
|
|
|
insert into t1 values (1);
|
2017-07-31 10:42:48 +02:00
|
|
|
insert into t2 values (2);
|
|
|
|
update t1, t2 set t1.x=11, t2.x=22;
|
2016-12-18 18:06:43 +01:00
|
|
|
sync_slave_with_master;
|
|
|
|
select * from t1;
|
2017-07-31 10:42:48 +02:00
|
|
|
select * from t2;
|
2016-12-18 18:06:43 +01:00
|
|
|
select * from t1 for system_time all;
|
2017-07-31 10:42:48 +02:00
|
|
|
select * from t2 for system_time all;
|
2016-12-18 18:06:43 +01:00
|
|
|
|
2016-12-26 16:46:02 +01:00
|
|
|
|
2016-12-16 12:11:23 +01:00
|
|
|
connection master;
|
2017-07-31 10:42:48 +02:00
|
|
|
drop table t1, t2;
|