CakeDC/search — pull request #34 by billyrennekamp (2012-02-06 02:54:17+00:00)
Title: 1.3

subquery is dependent so if you wrap it again it allows the query to complete in time to finish the rest. relevant to HABTM searching.

see post at http://stackoverflow.com/questions/9154881/using-mysql-in-causes-loop for details

changed
$conditions[] = array("$fieldName in ($subquery)");

to
$conditions[] = array("$fieldName in (SELECT * FROM($subquery) x");