I upgraded from 4.1.8 to 5.1.40 and am having a problem with queries where the dates contains single digit day or month. The first query below worked fine before on 4.1.8 - also if I create a new table in 5.1.40 it works fine, but not on the upgraded data. Dumping and re-creating tables isn't an option. Any ideas how to correct?
mysql [db]> select count(id) from TABLE where DateField>='2008-01-5';
+-----------+
| count(id) |
+-----------+
| 1 |
+-----------+
mysql [db]> select count(id) from TABLE where DateField>= cast('2008-01-5' as date);
+-----------+
| count(id) |
+-----------+
| 2 |
+-----------+