title: MySQL Error Code: 1411. Incorrect datetime value: '' for function str_to_date
body: <p>I have been asked to make changes to an existing application that at this time is only deployed to a Linux Production server.  I have gone ahead and have the app for the most part working on my local Windows PC.  I have a full copy of the <code>MySQL</code> DB from Production installed on my local PC.  The Production DB is <code>MySQL v5.0.95</code> on Linux and my local DB is <code>MySQL v5.5</code> on Windows.  Both are in InnoDB mode.</p>
  
  <p>My issue is with a statement such as the following.  Made generic for ease of use by others wanting to help.</p>
  
  <pre><code>update atable 
  set adate=DATE_ADD(str_to_date('','%m/%d/%Y'), INTERVAL 0 DAY)
  where anum='1'
  </code></pre>
  
  <p>In some cases an empty string is passed in which in Production does not cause any issues and allows the record to be saved/updated but locally it throws a <code>SQLException</code>.  So I tried the <code>SQL</code> statement directly against my local DB and I get the following error message in both cases.</p>
  
  <blockquote>
    <p>Error Code: 1411. Incorrect datetime value: '' for function
    str_to_date</p>
  </blockquote>
  
  <p>I've looked at the Production <code>my.cnf</code> and my local <code>my.ini</code> looking for any major differences and I have also tried to use the sql-mode "<code>ALLOW_INVALID_DATES</code>" locally but it did not change the end result.</p>
  
  <p>I know that I could change the code to not pass in these empty strings in but there are many statements like this and at this time I do not wish to make changes to all of these if possible.  This customer has a limited budget and timeframe and I want to focus on their new requirements.  I'm looking for input as to how I can get my local environment working as it does in Production if possible.</p>
  
  <p>Thanks for your time.</p>