Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.1(EOL), 11.2(EOL), 11.4, 11.6(EOL), 11.7
-
None
Description
It is suspected that binary logging may fail when a certain setup involving a trigger is used. For example;
CREATE TABLE t1 (c INT) ENGINE=InnoDB; |
SET SESSION sql_mode='TRADITIONAL'; |
CREATE TRIGGER wl1_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (CURRENT_USER()); |
CREATE TEMPORARY TABLE t1 ENGINE=InnoDB AS SELECT 1; |
SET GLOBAL slave_run_triggers_for_rbr=YES; |
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; |
BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA='; |
Leads to
CS 11.2.6 e91a79945822def1452787f825e6047c6a64dbd9 (Debug) |
11.2.6-dbg>BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
|
ERROR 1366 (22007): Incorrect integer value: 'root@localhost' for column `test`.`t1`.`1` at row 1
|
And in the error log we see:
CS 11.2.6 e91a79945822def1452787f825e6047c6a64dbd9 (Debug) |
2024-09-14 13:38:03 4 [ERROR] BINLOG_BASE64_EVENT: Could not execute Write_rows_v1 event on table test.t1; Incorrect integer value: 'root@localhost' for column `test`.`t1`.`1` at row 1, Error_code: 1366; At line 1 in test.wl1_trg1, Error_code: 4094; handler error HA_ERR_GENERIC; the event's master log FIRST, end_log_pos 610, Internal MariaDB error code: 1366
|
With this testcase (same, but without the TEMPORARY table):
CREATE TABLE t1 (c INT) ENGINE=InnoDB; |
SET SESSION sql_mode='TRADITIONAL'; |
CREATE TRIGGER wl1_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (CURRENT_USER()); |
SET GLOBAL slave_run_triggers_for_rbr=YES; |
BINLOG ' SOgWTg8BAAAAbgAAAHIAAAAAAAQANS42LjMtbTUtZGVidWctbG9nAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAABI6BZOEzgNAAgAEgAEBAQEEgAAVgAEGggAAAAICAgCAAAAAAVAYI8='; |
BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA='; |
We see:
CS 11.2.6 e91a79945822def1452787f825e6047c6a64dbd9 (Debug) |
11.2.6-opt>BINLOG 'wlZOTxMBAAAAKgAAADwCAAAAACkAAAAAAAEABHRlc3QAAnQxAAIDAwAC wlZOTxcBAAAAJgAAAGICAAAAACkAAAAAAAEAAv/8AgAAAAgAAAA=';
|
ERROR 1442 (HY000): Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger
|
And
CS 11.2.6 e91a79945822def1452787f825e6047c6a64dbd9 (Debug) |
2024-09-14 13:44:53 4 [ERROR] BINLOG_BASE64_EVENT: Could not execute Write_rows_v1 event on table test.t1; Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger, Error_code: 1442; At line 1 in test.wl1_trg1, Error_code: 4094; handler error HA_ERR_GENERIC; the event's master log FIRST, end_log_pos 610, Internal MariaDB error code: 1442
|
Attachments
Issue Links
- relates to
-
MDEV-33793 Slave halts upon DELETE trigger leading to errors 1442 and 4094
- Confirmed