title: Is there a MySQL setting to ignore "time" portion of datetime constant when applied to "DATE" column?
body: <blockquote>
    <p>Disclaimer: this is needed for an old and ugly codebase that I'd much rather not touch.</p>
  </blockquote>
  
  <ul>
  <li>There is a table in the database that has a column (among many others) of <code>DATE</code> type.</li>
  <li>There is a query (auto generated by Torque criteria - don't ask) with <code>java.util.Date</code> parameter; Torque formats it as full datetime.</li>
  </ul>
  
  <p>So, the query MySQL is getting is something like:</p>
  
  <pre><code>SELECT * FROM my_table
   WHERE my_date = '20091201105320'; // 2009-12-01 10:53:20
  </code></pre>
  
  <p>The problem is that on one server which has MySQL 5.0.27-standard it works just fine - as in returns all the records from <code>my_table</code> that have <code>my_date</code> set to '2009-12-01'. On another server which has MySQL 5.0.45 it does not work. The data is there - if I manually run the query after trimming the time portion out I get correct results back.</p>
  
  <p>The question is:</p>
  
  <p>Is there a setting somewhere, either in MySQL configuration file or in per-session variables (connection string) or somewhere else to force MySQL to ignore the time portion during string constant to date conversion?</p>
  
  <p>I obviously can't use <code>DATE()</code> function without changing the codebase which I'd much rather not.</p>