apinstein/phocoa — pull request #38 by ardell (2012-01-30 19:23:09+00:00)
Title: WFPagination::itemCount breaks with more than one "FROM" in query

Fixed bug where WFPagination::itemCount was causing invalid sql in cases where there was more than one 'from' in a query (e.g. temporary tables, sub-selects, EPOCH FROM casting, etc).

We attempt backwards-compatibility by detecting the number of times "from" exists in the base query--if more than once, we run our magic performance hack, otherwise we disable it, take the performance hit, and get a valid sql statement anyway.