Added two tests for testing readwrite split router's ability to route read to master if in active transaction and to slave when outside transaction.

This commit is contained in:
VilhoRaatikka
2014-03-27 10:27:19 +02:00
parent 75549c6a20
commit 10fdccdeee
4 changed files with 22 additions and 32 deletions

View File

@ -1,3 +1,11 @@
USE test;
SET autocommit = 0;
SELECT @@in_transaction INTO @a;
SELECT @a;
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;