UPDATE IGNORE and REPLACE always return " Deadlock found..."
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership | Status tracked in 5.6 | |||||
5.6 |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
In stock MySQL , UPDATE IGNORE and REPLACE are used to silence errors that may have happened during the DML. In Galera, those statements do not work and always return a "Deadlock found when trying to get lock; try restarting transaction".
Note that UPDATE IGNORE may not be safe to replicate. Here is a related mysql error message:
"Error: 1719 SQLSTATE: HY000 (ER_BINLOG_
Message: UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave."
Test cases:
create table t2 (f1 integer primary key) engine=innodb;
insert into t2 values (1),(2);
update ignore t2 set f1=2 where f1=1;
update t2 set f1=2 where f1=1;
create table t2 (f1 integer primary key) engine=innodb;
insert into t2 values (1);
replace into t2 values (1);
INSERT IGNORE is also affected.