Skip to content

How does your database count?

Just found out a curiosity which was only recently fixed:


If you ask a database for a SELECT COUNT(1) you expect to have a result of '1' counted (or get an error because of the missing FROM, like Oracle does). But Mysql until version 5.0.24a returns '0'. Starting with version 5.0.27 it returns the correct '1';


So Mysql was not only counting your input in a wrong way, the developers also changed the output behaviour during minor (bugfix) releases. Anybody seen a note about this change (which was not hidden in some dozen changelog pages)?