title: Old date comparison handling in new MySQL
body: <p>The migration guide for MySQL 5.0 says that the way comparisons are done between DATEs and DATETIMEs has changed.</p>
  
  <blockquote>
    <p>Incompatible change: Beginning with MySQL 5.0.42, when a DATE value is compared with a DATETIME value, the DATE value is coerced to the DATETIME type by adding the time portion as 00:00:00. Previously, the time portion of the DATETIME value was ignored, or the comparison could be performed as a string comparison. To mimic the old behavior, use the CAST() function to cause the comparison operands to be treated as previously. For example:</p>
  </blockquote>
  
  <p>So for example "select ... where my_date &lt; now()" now do DATETIME comparisons (which would include today at 00:00:00) and used to do DATE comparisons (which would not include today).</p>
  
  <p>Is there e.g. a MySQL config option which enables the old behaviour? I couldn't find any yet but that doesn't necessarily mean it isn't there.</p>
  
  <p>We have > 100 KLOC of code with multiple SQL statements regarding billing which all rely on the old date processing.</p>