silverstripe/sapphire — pull request #1247 by ajshort (2013-03-01 00:21:57+00:00)
Title: BUG: Fix ManyManyList->removeAll() when filters are applied to the query

In order to be cross-database compatible and support filters, the IDs to
delete must be retrieved in a sub-query.

The sub-query cannot be joined to the table in the deletion target due to MySQL locking issues. As such, a bit of query fiddling is needed.