We (me coding, Igor and Evgen reviewing) have fixed BUG#32198. According to Support/Bugs team, the bug was causing pain to a number of people, so I thought it deserved a post. The problem was as follows:
- Before MySQL 5.0.42, comparisons in form
date_column CMP datetime_const
were interpreted as comparisons of DATEs (CMP is one of =, <, > , <=, or >=). The time part of datetime_const was ignored.
- In 5.0.42 we've fixed it to perform in a way that is closer
to the SQL standard: the comparisons are now resolved by
comparing values as DATETIMEs. Our fault was that "date_column
CMP datetime_const" stopped being sargable. It turned out there
quite a few people who had queries like
SELECT ... WHERE date_column < NOW() ...and those queries became awfully slow.
…