Added missing test files for rwsplit router tests.
This commit is contained in:
@ -0,0 +1,7 @@
|
|||||||
|
use test;
|
||||||
|
drop table if exists t1;
|
||||||
|
create table t1 (id integer);
|
||||||
|
set autocommit=OFF; -- open transaction
|
||||||
|
insert into t1 values(1); -- write to master
|
||||||
|
select count(*) from t1; -- read from master
|
||||||
|
drop table t1;
|
@ -0,0 +1,11 @@
|
|||||||
|
USE test;
|
||||||
|
SET autocommit = Off;
|
||||||
|
START TRANSACTION;
|
||||||
|
CREATE TABLE IF NOT EXISTS myCity (a int, b char(20));
|
||||||
|
INSERT INTO myCity VALUES (1, 'Milan');
|
||||||
|
INSERT INTO myCity VALUES (2, 'London');
|
||||||
|
COMMIT;
|
||||||
|
START TRANSACTION;
|
||||||
|
DELETE FROM myCity;
|
||||||
|
SELECT COUNT(*) FROM myCity; -- read transaction's modifications from master
|
||||||
|
COMMIT;
|
@ -0,0 +1,7 @@
|
|||||||
|
-- Read from slave after implicit COMMIT
|
||||||
|
USE test;
|
||||||
|
START TRANSACTION;
|
||||||
|
CREATE TABLE IF NOT EXISTS T2 (id integer);
|
||||||
|
INSERT INTO T2 VALUES (@@server_id);
|
||||||
|
SET AUTOCOMMIT=oN;
|
||||||
|
SELECT id from T2; -- read transaction's modifications from slave
|
@ -0,0 +1,9 @@
|
|||||||
|
USE test;
|
||||||
|
SET autocommit = oFf;
|
||||||
|
CREATE TABLE IF NOT EXISTS myCity (a int, b char(20));
|
||||||
|
INSERT INTO myCity VALUES (1, 'Milan');
|
||||||
|
INSERT INTO myCity VALUES (2, 'London');
|
||||||
|
COMMIT;
|
||||||
|
DELETE FROM myCity; -- implicit transaction started
|
||||||
|
SELECT COUNT(*) FROM myCity; -- read transaction's modifications from master
|
||||||
|
COMMIT;
|
Reference in New Issue
Block a user