1
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
2
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
3
SET BINLOG_FORMAT=STATEMENT;
5
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
6
ERROR HY000: Transaction isolation level 'READ-COMMITTED' is not safe for 'STATEMENT' binlog mode
7
UPDATE t1 SET b = a*a WHERE a > 1;
10
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
11
UPDATE t1 SET b = a*a WHERE a > 1;
14
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
15
UPDATE t1 SET b = a*a WHERE a > 1;
17
SET BINLOG_FORMAT=MIXED;
19
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
20
ERROR HY000: Transaction isolation level 'READ-COMMITTED' is not safe for 'MIXED' binlog mode
21
UPDATE t1 SET b = a*a*a WHERE a > 2;
23
SET BINLOG_FORMAT=ROW;
25
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
26
UPDATE t1 SET b = a*a*a*a WHERE a > 3;
28
SELECT @@session.tx_isolation, @@session.binlog_format;
29
@@session.tx_isolation READ-COMMITTED
30
@@session.binlog_format ROW
32
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
33
SET BINLOG_FORMAT=MIXED;
34
ERROR HY000: Transaction isolation level 'READ-COMMITTED' prevents leaving 'ROW' binlog mode
35
UPDATE t1 SET b = a*a*a*a WHERE a > 3;
37
SELECT @@session.tx_isolation, @@session.binlog_format;
38
@@session.tx_isolation READ-COMMITTED
39
@@session.binlog_format ROW
41
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
42
SET BINLOG_FORMAT=STATEMENT;
43
ERROR HY000: Transaction isolation level 'READ-COMMITTED' prevents leaving 'ROW' binlog mode
44
UPDATE t1 SET b = a*a*a*a WHERE a > 3;
46
SELECT @@session.tx_isolation, @@session.binlog_format;
47
@@session.tx_isolation READ-COMMITTED
48
@@session.binlog_format ROW