@@ -37,14 +37,22 @@ CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT I
...
@@ -37,14 +37,22 @@ CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT I
INSERT INTO t_self_logging VALUES (1);
INSERT INTO t_self_logging VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging.
ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging.
DROP trigger trig_1;
DROP trigger trig_1;
SELECT * FROM t_self_logging /* Should be empty */;
a
SELECT * FROM t /* Should be empty */;
a
* Modify both row-only and stmt-only table
* Modify both row-only and stmt-only table
CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END;
CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END;
INSERT INTO t_stmt VALUES (1);
INSERT INTO t_stmt VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved.
ERROR HY000: Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved.
SELECT * FROM t_stmt /* should be empty */;
a
DROP TRIGGER trig_2;
DROP TRIGGER trig_2;
* Stmt-only table and binlog_format=row
* Stmt-only table and binlog_format=row
INSERT INTO t_stmt VALUES (1);
INSERT INTO t_stmt VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging.
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging.
SELECT * FROM t_stmt /* should be empty */;
a
* Row injection and stmt-only table: in slave sql thread
* Row injection and stmt-only table: in slave sql thread
INSERT INTO t_slave_stmt VALUES (1);
INSERT INTO t_slave_stmt VALUES (1);
[on slave]
[on slave]
...
@@ -52,12 +60,17 @@ INSERT INTO t_slave_stmt VALUES (1);
...
@@ -52,12 +60,17 @@ INSERT INTO t_slave_stmt VALUES (1);
Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.' on opening tables
Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.' on opening tables
set global sql_slave_skip_counter=1;
set global sql_slave_skip_counter=1;
include/start_slave.inc
include/start_slave.inc
SELECT * FROM t_slave_stmt /* should be empty */;
a
[on master]
* Row injection and stmt-only table: use BINLOG statement
* Row injection and stmt-only table: use BINLOG statement
ERROR HY000: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.
ERROR HY000: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.
SELECT * FROM t_stmt /* should be empty */;
a
---- binlog_format=mixed ----
---- binlog_format=mixed ----
[on slave]
[on slave]
include/stop_slave.inc
include/stop_slave.inc
...
@@ -83,21 +96,30 @@ SET @@session.binlog_format = STATEMENT;
...
@@ -83,21 +96,30 @@ SET @@session.binlog_format = STATEMENT;
* Row-only engine and binlog_format=statement: innodb-specific message
* Row-only engine and binlog_format=statement: innodb-specific message
INSERT INTO t_row VALUES (1);
INSERT INTO t_row VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
SELECT * FROM t_row /* should be empty */;
a
* Row-only engine and binlog_format=statement: generic message
* Row-only engine and binlog_format=statement: generic message
SET @@session.debug= '+d,no_innodb_binlog_errors';
SET @@session.debug= '+d,no_innodb_binlog_errors';
INSERT INTO t_row VALUES (1);
INSERT INTO t_row VALUES (1);
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging.
ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging.
SELECT * FROM t_row /* should be empty */;
a
* Same statement, but db filtered out - no error
* Same statement, but db filtered out - no error
USE other;
USE other;
INSERT INTO test.t_row VALUES (1);
INSERT INTO test.t_row VALUES (1);
USE test;
USE test;
SET @@session.debug= '';
SET @@session.debug= '';
SELECT * FROM t_row /* should contain the value 1 */;
a
1
* Row injection and binlog_format=statement: BINLOG statement
* Row injection and binlog_format=statement: BINLOG statement
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave.
SELECT * FROM t /* should contain the value 1 */;
a
1
DELETE FROM t;
* Same statement, but db filtered out - no message
* Same statement, but db filtered out - no message