mirror of
https://github.com/MariaDB/server.git
synced 2025-08-26 01:44:06 +03:00
BUG#50479 DDL stmt on row-only/stmt-only tables generate spurious binlog_format
errors In the fix of BUG#39934 in 5.1-rep+3, errors are generated when binlog_format=row and a statement modifies a table restricted to statement-logging (ER_BINLOG_ROW_MODE_AND_STMT_ENGINE); or if binlog_format=statement and a statement modifies a table restricted to row-logging (ER_BINLOG_STMT_MODE_AND_ROW_ENGINE). However, some DDL statements that lock tables (e.g. ALTER TABLE, CREATE INDEX and CREATE TRIGGER) were causing spurious errors, although no row might be inserted into the binary log. To fix the problem, we tagged statements that may generate rows into the binary log and thence the warning messages are only printed out when the appropriate conditions hold and rows might be changed.
This commit is contained in:
@@ -22,7 +22,7 @@ SET AUTOCOMMIT = 1;
|
||||
BEGIN;
|
||||
UPDATE t SET f = 'yellow 2' WHERE i = 3;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
|
||||
SET AUTOCOMMIT = 1;
|
||||
BEGIN;
|
||||
UPDATE t SET f = 'magenta 2' WHERE f = 'red';
|
||||
@@ -51,7 +51,7 @@ SET AUTOCOMMIT = 1;
|
||||
BEGIN;
|
||||
UPDATE t SET f = 'gray 2' WHERE i = 3;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
|
||||
SET AUTOCOMMIT = 1;
|
||||
BEGIN;
|
||||
UPDATE t SET f = 'dark blue 2' WHERE f = 'red';
|
||||
@@ -77,7 +77,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'yellow 1' WHERE i = 3;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'magenta 1' WHERE f = 'red';
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
@@ -104,7 +104,7 @@ master-bin.000001 # Query # # ROLLBACK
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'gray 1' WHERE i = 3;
|
||||
Warnings:
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statements that read from both transactional (or a temporary table of any engine type) and non-transactional tables and write to any of them are unsafe.
|
||||
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
|
||||
SET AUTOCOMMIT = 0;
|
||||
UPDATE t SET f = 'dark blue 1' WHERE f = 'red';
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
|
Reference in New Issue
Block a user