polardbxengine/mysql-test/suite/xengine/r/cons_snapshot_read_committe...

169 lines
4.3 KiB
Plaintext

DROP TABLE IF EXISTS t1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con1;
CREATE TABLE t1 (a INT, pk INT AUTO_INCREMENT PRIMARY KEY) ENGINE=XENGINE;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
connection con2;
select * from information_schema.xengine_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 0
connection con1;
COMMIT;
connection con2;
select * from information_schema.xengine_dbstats where stat_type='DB_NUM_SNAPSHOTS';
STAT_TYPE VALUE
DB_NUM_SNAPSHOTS 0
connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
connection con2;
INSERT INTO t1 (a) VALUES (1);
connection con1;
# If consistent read works on this isolation level (READ COMMITTED), the following SELECT should not return the value we inserted (1)
SELECT a FROM t1;
a
1
COMMIT;
connection default;
disconnect con1;
disconnect con2;
DROP TABLE t1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection con1;
CREATE TABLE r1 (id int primary key, value int, value2 int) engine=XENGINE;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into r1 values (1,1,1),(2,2,2),(3,3,3),(4,4,4);
BEGIN;
connection con2;
INSERT INTO r1 values (5,5,5);
connection con1;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
connection con2;
INSERT INTO r1 values (6,6,6);
connection con1;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
COMMIT;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
connection con2;
INSERT INTO r1 values (7,7,7);
connection con1;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
connection con2;
INSERT INTO r1 values (8,8,8);
connection con1;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
COMMIT;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
connection con2;
INSERT INTO r1 values (9,9,9);
connection con1;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
connection con2;
INSERT INTO r1 values (10,10,10);
connection con1;
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
START TRANSACTION WITH CONSISTENT SNAPSHOT;
Warnings:
Warning 138 Only REPEATABLE READ isolation level is supported for START TRANSACTION WITH CONSISTENT SNAPSHOT in XEngine Storage Engine. Snapshot has not been taken
Warning 138 InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level.
ERROR: 0
INSERT INTO r1 values (11,11,11);
ERROR: 1105
SELECT * FROM r1;
id value value2
1 1 1
2 2 2
3 3 3
4 4 4
5 5 5
6 6 6
7 7 7
8 8 8
9 9 9
10 10 10
drop table r1;
connection default;
disconnect con1;
disconnect con2;