cakephp/cakephp — pull request #3157 by bar (2014-03-29 05:33:16+00:00)
Title: Avoid ordering when counting.

This not only optimizes the query, but also avoid errors caused when
ordering by fields set in the WHERE clause, because count() overrides
them by default.