wsrep_slave_FK_checks not working
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.6 |
Confirmed
|
Undecided
|
Unassigned | |||
5.7 |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
wsrep_slave_
How to reproduce:
node1:
CREATE DATABASE IF NOT EXISTS fk;
use fk;
CREATE TABLE fk.parent ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB;
CREATE TABLE fk.child ( `id` int(11) NOT NULL, `pId` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_parent` (`pId`), CONSTRAINT `fk_parent` FOREIGN KEY (`pId`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB;
INSERT INTO fk.parent VALUES (1),(2),(3);
INSERT INTO fk.child VALUES (1,1),(2,2),(3,3);
node2:
add wsrep_slave_
restart mysql
node1:
set sql_log_bin=0; DELETE FROM fk.child WHERE id = 1; set sql_log_
From what I can see, nodes are honoring the session variable from master. On GRA_ file we can see SET @@session.
[root@marcelo_
/*!50530 SET @@SESSION.
/*!50003 SET @OLD_COMPLETION
DELIMITER /*!*/;
# at 4
#170519 16:50:05 server id 2 end_log_pos 123 Start: binlog v 4, server v 5.7.17-13-57-log created 170519 16:50:05
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
fVofWQ8CAAAAdwA
AAAAAAAAAAAAAAA
AGFXQe4=
'/*!*/;
# at 123
#170519 16:50:05 server id 2 end_log_pos 150 Previous-GTIDs
# [empty]
# at 150
#170519 16:44:13 server id 1 end_log_pos 71 Query thread_id=7 exec_time=0 error_code=0
SET TIMESTAMP=
SET @@session.
SET @@session.
SET @@session.
SET @@session.
/*!\C latin1 *//*!*/;
SET @@session.
SET @@session.
SET @@session.
BEGIN
/*!*/;
# at 221
#170519 16:44:13 server id 1 end_log_pos 114 Table_map: `fk`.`parent` mapped to number 109
# at 264
#170519 16:44:13 server id 1 end_log_pos 150 Delete_rows: table id 109 flags: STMT_END_F
BINLOG '
HVkfWRMBAAAAKwA
HVkfWSABAAAAJAA
'/*!*/;
### DELETE FROM `fk`.`parent`
### WHERE
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
ROLLBACK /* added by mysqlbinlog */ /*!*/;
SET @@SESSION.
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_
/*!50530 SET @@SESSION.
Workaround:
Add to my.cnf
init_connect='SET foreign_
Run on MySQL:
SET GLOBAL init_connect='SET foreign_
description: | updated |
description: | updated |
Changed in percona-xtradb-cluster: | |
status: | New → Confirmed |
tags: | added: i188973 |
Tested on 5.6.35-81.0-56 and 5.7.17-13-57 . Both versions are affected