title: sqlite insert or ignore always inserts on empty field
body: <p>I am getting multiple inserts when a field is empty despite using <code>insert or ignore</code> with a primary key. I also tried adding a unique index, just to be sure. I only want new inserts when the primary key is not equal to any existing row. </p>
  
  <p>According to <a href="https://www.sqlite.org/nulls.html" rel="nofollow">sqlite.org/nulls.html</a> <code>nulls are distinct in a UNIQUE column</code> these duplicate inserts should not happen.</p>
  
  <p>I'm doing this insert: </p>
  
  <pre><code>INSERT OR IGNORE INTO facts (
    created,
    inserted,
    author,
    kind,
    what,
    field,
    val
    ) VALUES (?, ?, ?, ?, ?, ?, ?)
  </code></pre>
  
  <p>with this table:</p>
  
  <pre><code>CREATE TABLE IF NOT EXISTS facts (
    created TEXT,
    inserted TEXT,
    author TEXT,
    kind TEXT,
    what TEXT,
    field TEXT,
    val TEXT,
    PRIMARY KEY(created, author, kind, what, field, val)
    )
  </code></pre>
  
  <p>and getting this result after doing the same inserts multiple times:</p>
  
  <pre><code>sqlite&gt; select * from facts where what='vot1dafjt95326qvs8kn' order by inserted;
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643060|test_user_id|TaskFact|vot1dafjt95326qvs8kn|created|2014-01-29T09:30:44.000000
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643152|test_user_id|TaskFact|vot1dafjt95326qvs8kn|alarm|
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643315|test_user_id|TaskFact|vot1dafjt95326qvs8kn|deleted|
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643380|test_user_id|TaskFact|vot1dafjt95326qvs8kn|description|
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643445|test_user_id|TaskFact|vot1dafjt95326qvs8kn|location|KG45
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643641|test_user_id|TaskFact|vot1dafjt95326qvs8kn|summary|semtid
  2014-01-29T09:30:44.000000|2015-07-23T13:23:10.643780|test_user_id|TaskFact|vot1dafjt95326qvs8kn|when|TS('2014-03-14T07:00:00.000000', '2014-03-14T11:00:00.000000')
  2014-01-29T09:30:44.000000|2015-07-23T13:23:35.559110|test_user_id|TaskFact|vot1dafjt95326qvs8kn|alarm|
  2014-01-29T09:30:44.000000|2015-07-23T13:23:35.559273|test_user_id|TaskFact|vot1dafjt95326qvs8kn|deleted|
  2014-01-29T09:30:44.000000|2015-07-23T13:24:12.548969|test_user_id|TaskFact|vot1dafjt95326qvs8kn|alarm|
  2014-01-29T09:30:44.000000|2015-07-23T13:24:12.549186|test_user_id|TaskFact|vot1dafjt95326qvs8kn|deleted|
  2014-01-29T09:30:44.000000|2015-07-23T13:25:39.638743|test_user_id|TaskFact|vot1dafjt95326qvs8kn|alarm|
  2014-01-29T09:30:44.000000|2015-07-23T13:25:39.638906|test_user_id|TaskFact|vot1dafjt95326qvs8kn|deleted|
  </code></pre>
  
  <p>The <code>deleted</code> and <code>alarm</code> rows are inserted multiple times, but the other rows are only inserted once.</p>
  
  <p>I am doing the inserts from python3 using the <code>sqlite3</code> module.</p>