|
I also ran into this, in another way:
# Requires standard m/s setup
|
SET sql_mode='',unique_checks=0,foreign_key_checks=0,autocommit=0;
|
CREATE TABLE t1 (c1 INT UNIQUE KEY) ENGINE=InnoDB;
|
CREATE TABLE t2 (c1 BINARY (0),c2 INT UNIQUE KEY) ENGINE=InnoDB;
|
INSERT INTO t2 VALUES (0,0);
|
INSERT INTO t1 VALUES (0,0);
|
CREATE TEMPORARY TABLE t1 (c INT);
|
INSERT INTO t2 VALUES (0,0);
|
Leads to:
|
11.4.0 8bf9f21855606ddeb0fe90fb1e70165adbec6746 (Debug)
|
2024-02-03 9:48:58 6 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.t2; Duplicate entry '0' for key 'c2', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log binlog.000001, end_log_pos 0, Gtid 0-1-6, Internal MariaDB error code: 1062
|
2024-02-03 9:48:58 6 [Warning] Slave: Duplicate entry '0' for key 'c2' Error_code: 1062
|
2024-02-03 9:48:58 6 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000001' position 1307; GTID position '0-1-5'
|
|
11.4.0 8bf9f21855606ddeb0fe90fb1e70165adbec6746 (Optimized)
|
2024-02-03 9:47:55 6 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.t2; Duplicate entry '0' for key 'c2', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log binlog.000001, end_log_pos 0, Gtid 0-1-6, Internal MariaDB error code: 1062
|
2024-02-03 9:47:55 6 [Warning] Slave: Duplicate entry '0' for key 'c2' Error_code: 1062
|
2024-02-03 9:47:55 6 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000001' position 1307; GTID position '0-1-5'
|
|
|
Yet another way (XA):
# Requires standard m/s setup
|
CREATE TABLE ti (a INT,b INT UNSIGNED,c CHAR,d BINARY,e BINARY,f CHAR,g BLOB,h BLOB,id INT,KEY(b),KEY(e),PRIMARY KEY(id));
|
XA START 'a';
|
INSERT INTO ti VALUES (+1,+1,0,0,0,0,0,0,3);
|
SET foreign_key_checks=0,unique_checks=0;
|
CREATE TEMPORARY TABLE t2 (a INT,b INT,PRIMARY KEY(a));
|
INSERT INTO t2 VALUES (0,6),(0,7);
|
INSERT INTO ti VALUES (+1,1,0,0,0,0,0,0,3);
|
Leads to:
|
11.4.0 8bf9f21855606ddeb0fe90fb1e70165adbec6746 (Debug)
|
2024-02-03 14:46:17 6 [ERROR] Slave SQL: Could not execute Write_rows_v1 event on table test.ti; Duplicate entry '3' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log binlog.000001, end_log_pos 0, Gtid 0-1-5, Internal MariaDB error code: 1062
|
2024-02-03 14:46:17 6 [Warning] Slave: Duplicate entry '3' for key 'PRIMARY' Error_code: 1062
|
2024-02-03 14:46:17 6 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log 'binlog.000001' position 1198; GTID position '0-1-4'
|
|
|
This can also be seen as a warning when using --slave_skip_errors=ALL:
|
11.4.0 8bf9f21855606ddeb0fe90fb1e70165adbec6746 (Debug)
|
2024-01-02 20:10:44 12 [Warning] Slave SQL: Could not execute Write_rows_v1 event on table test.ti; Duplicate entry '12' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log binlog.000003, end_log_pos 10498, Gtid 0-1-162, Internal MariaDB error code: 1062
|
|