MariaDB [(none)]> SHOW SLAVE STATUS \G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: mariadb-0.mariadb Master_User: maxscale Master_Port: 3306 Connect_Retry: 60 Master_Log_File: mysqld-bin.000078 Read_Master_Log_Pos: 314778473 Relay_Log_File: mysqld-relay-bin.000124 Relay_Log_Pos: 1071195805 Relay_Master_Log_File: mysqld-bin.000076 Slave_IO_Running: Yes Slave_SQL_Running: No Replicate_Rewrite_DB: Replicate_Do_DB: Replicate_Ignore_DB: Replicate_Do_Table: Replicate_Ignore_Table: Replicate_Wild_Do_Table: Replicate_Wild_Ignore_Table: Last_Errno: 1062 Last_Error: Could not execute Write_rows_v1 event on table wpjshop_prod_oveckarna_db.sections_relation; Duplicate entry '8-7' for key 'id_section_2', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysqld-bin.000076, end_log_pos 1071195793 Skip_Counter: 0 Exec_Master_Log_Pos: 1071195505 Relay_Log_Space: 2462348204 Until_Condition: None Until_Log_File: Until_Log_Pos: 0 Master_SSL_Allowed: No Master_SSL_CA_File: Master_SSL_CA_Path: Master_SSL_Cert: Master_SSL_Cipher: Master_SSL_Key: Seconds_Behind_Master: NULL Master_SSL_Verify_Server_Cert: No Last_IO_Errno: 0 Last_IO_Error: Last_SQL_Errno: 1062 Last_SQL_Error: Could not execute Write_rows_v1 event on table wpjshop_prod_oveckarna_db.sections_relation; Duplicate entry '8-7' for key 'id_section_2', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log mysqld-bin.000076, end_log_pos 1071195793 Replicate_Ignore_Server_Ids: Master_Server_Id: 100 Master_SSL_Crl: Master_SSL_Crlpath: Using_Gtid: Current_Pos Gtid_IO_Pos: 1-101-612432257,0-1-1834492326,2-100-8778876189 Replicate_Do_Domain_Ids: Replicate_Ignore_Domain_Ids: Parallel_Mode: optimistic SQL_Delay: 0 SQL_Remaining_Delay: NULL Slave_SQL_Running_State: Slave_DDL_Groups: 82879 Slave_Non_Transactional_Groups: 3045 Slave_Transactional_Groups: 38076863 1 row in set (0.000 sec) MariaDB [wpjshop_prod_oveckarna_db]> SHOW CREATE TABLE sections_relation \G *************************** 1. row *************************** Table: sections_relation Create Table: CREATE TABLE `sections_relation` ( `id_section` int(11) NOT NULL DEFAULT 0, `id_topsection` int(11) DEFAULT NULL, `position` int(11) NOT NULL DEFAULT 0, UNIQUE KEY `id_section_2` (`id_section`,`id_topsection`), KEY `sections_ibfk_2` (`id_topsection`), CONSTRAINT `sections_relation_ibfk_1` FOREIGN KEY (`id_section`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `sections_relation_ibfk_2` FOREIGN KEY (`id_topsection`) REFERENCES `sections` (`id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='Relace sekci' 1 row in set (0.000 sec) MariaDB [wpjshop_prod_oveckarna_db]> SHOW CREATE TRIGGER trigger_sections_relation \G *************************** 1. row *************************** Trigger: trigger_sections_relation sql_mode: NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SQL Original Statement: CREATE DEFINER=`wpjshop_prod_oveckarna_db`@`%` TRIGGER trigger_sections_relation BEFORE INSERT ON sections_relation FOR EACH ROW BEGIN IF NEW.position IS NULL THEN SET NEW.position = (SELECT COALESCE(MAX(sections_relation.position) + 1, 0) FROM sections_relation WHERE id_topsection = NEW.id_topsection); END IF; END character_set_client: utf8mb4 collation_connection: utf8mb4_general_ci Database Collation: utf8mb4_general_ci Created: 2023-06-27 03:58:46.63 1 row in set (0.000 sec)