summaryrefslogtreecommitdiff
path: root/mysql-test/t/partition_innodb_stmt.test
blob: c6f30f41969791fefaa2a846ea8c64be6228dcbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--source include/have_partition.inc
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc

--echo # connection default
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;

CREATE TABLE t1
(
  id SMALLINT NOT NULL,
  PRIMARY KEY (id)
) ENGINE=innodb
PARTITION BY RANGE (id)
(
  PARTITION p1 VALUES LESS THAN (2),
  PARTITION p2 VALUES LESS THAN (4),
  PARTITION p3 VALUES LESS THAN (10)
);

INSERT INTO t1 VALUES (1),(2),(3);

--echo # Test READ COMMITTED -> REPEATABLE READ
FLUSH TABLES;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
SELECT * FROM t1;

connect (con1, localhost, root,,);
connection con1;

--echo #connection con1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
INSERT INTO t1 VALUES(7);
COMMIT;

connection default;
--echo # connection default
COMMIT;

FLUSH TABLES;

--echo # Test REPEATABLE READ -> READ COMMITTED
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
SELECT * FROM t1;

connection con1;

--echo # connection con1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
INSERT INTO t1 VALUES(9);
COMMIT;

disconnect con1;
connection default;
COMMIT;
DROP TABLE t1;