Issue #1258000 by chx, bfroehle, xjm: Fixed SelectQuery::countQuery() inappropriately removes SQL expressions.