Bug #11220 Query causes all replicants to segfault
Submitted: 9 Jun 2005 20:40 Modified: 22 Jun 2005 15:20
Reporter: Greg Whalin Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:4.1.11 OS:Linux (Fedora Core 2)
Assigned to: Assigned Account CPU Architecture:Any

[9 Jun 2005 20:40] Greg Whalin
Description:
Executing the following query caused every slave to segfault and kill replication.  Some replicants simply lost the replication threads, and our Opterons crashed the entire mysqld instance.

update purchase pp, (select p.purchase_id from purchase p left join transaction t on p.purchase_id = t.purchase_id where  p.status='billed' and to_days(p.mtime) = to_days(now()) and t.transaction_id is null) d set pp.status='abandonded', pp.fullfillment_date = null where pp.purchase_id = d.purchase_id;

The query ran correctly on all servers when I ran locally on the machines, but killed replication.  To recover, had to manually run command and then skip this sql in the replication log.

How to repeat:
Got me?  Multi-table update using a derived (from subselect) table as one of the joins.

Ugly.
[22 Jun 2005 15:20] Lars Thalmann
Same as BUG#10442:
http://bugs.mysql.com/bug.php?id=10442