title: MYSQL upload from CSV maintaining nulls
body: <p>I have a MYSQL database containing a bunch of fields, many of which are configures as numerical values, either:</p>
  
  <blockquote>
    <blockquote>
      <p><code>thickness</code> double(7,2) DEFAULT NULL,</p>
    </blockquote>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <blockquote>
      <p><code>has_input</code> tinyint(4) DEFAULT NULL,</p>
    </blockquote>
  </blockquote>
  
  <p>I have to import a csv file into this table and have been using</p>
  
  <blockquote>
    <blockquote>
      <p>load data local infile 'myfilepath/file.csv' into table <code>combined</code> fields terminated by ',' enclosed by '"' lines terminated by '\r\n';</p>
    </blockquote>
  </blockquote>
  
  <p>but all numerical fields are having null values replaced by zero. This is really annoying as some fields have a legitimate value of zero and I need to be able to distinguish these from the fields with no value.</p>
  
  <p>As you can see above, the field defaults are set to null and, on other advice, I've entered \N in all the blank fields in the csv to indicate null.</p>
  
  <p>Nevertheless, the nulls are still being replaced with zero. Can you help?</p>