Added missing test files for rwsplit router tests.

This commit is contained in:
VilhoRaatikka 2014-04-16 10:25:32 +03:00
parent c994c81a0e
commit 81af54730a
4 changed files with 34 additions and 0 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;