mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
96 lines
2.1 KiB
Text
96 lines
2.1 KiB
Text
source include/have_innodb.inc;
|
|
source include/have_log_bin.inc;
|
|
|
|
SET BINLOG_FORMAT=MIXED;
|
|
|
|
RESET MASTER;
|
|
|
|
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=INNODB;
|
|
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6);
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
# Should be logged as statement
|
|
UPDATE t1 SET b = 2*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
# Should be logged as rows
|
|
UPDATE t1 SET b = a * a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
# Check that errors are generated when trying to use READ COMMITTED
|
|
# transaction isolation level in STATEMENT binlog mode.
|
|
|
|
SET BINLOG_FORMAT=STATEMENT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
error ER_BINLOG_LOGGING_IMPOSSIBLE;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
error ER_BINLOG_LOGGING_IMPOSSIBLE;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
SET BINLOG_FORMAT=MIXED;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
SET BINLOG_FORMAT=ROW;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
|
|
UPDATE t1 SET b = 1*a WHERE a > 1;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
|
UPDATE t1 SET b = 2*a WHERE a > 2;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
|
|
UPDATE t1 SET b = 3*a WHERE a > 3;
|
|
COMMIT;
|
|
|
|
BEGIN;
|
|
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
|
|
UPDATE t1 SET b = 4*a WHERE a > 4;
|
|
COMMIT;
|
|
|
|
source include/show_binlog_events.inc;
|
|
|
|
DROP TABLE t1;
|