bug 1682: r6312 was producing a MySQL error (depending on the MySQL server version) because a count() implies a group by.
This code change was checked against MySQL 5.0.75, MySQL 5.0.51 (where the error occured) and SQLite 3.6.22.