title: Rusqlite query with SUM panics with "InvalidColumnType(0, Null)"
body: <p>I have this working code:</p>
  
  <pre><code>extern crate rusqlite;
  
  use rusqlite::Connection;
  
  fn main() {
      let conn = Connection::open("db.sqlite").unwrap();
  
      conn.execute("CREATE TABLE toto (size INTEGER NOT NULL DEFAULT 0);", &amp;[]).unwrap();
      conn.execute("INSERT INTO toto(size) VALUES (42);", &amp;[]).unwrap();
  
      let filter = 0;
      let i: i64 = conn.query_row("SELECT SUM(size) FROM toto", &amp;[], |r| r.get(0)).unwrap();
      println!("Coucou");
      println!("Coucou: {}", i);
  }
  </code></pre>
  
  <p>But if I switch</p>
  
  <pre><code>"SELECT SUM(size) FROM toto", &amp;[]
  </code></pre>
  
  <p>to</p>
  
  <pre><code>"SELECT SUM(size) FROM toto WHERE size=?1", &amp;[&amp;filter]
  </code></pre>
  
  <p>and re-run, it panics:</p>
  
  <pre class="lang-none prettyprint-override"><code>rm db.sqlite
  RUST_BACKTRACE=1 cargo run
  </code></pre>
  
  <pre class="lang-none prettyprint-override"><code>        Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
           Running `target/debug/testsqlite`
      thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InvalidColumnType(0, Null)', /checkout/src/libcore/result.rs:860
  </code></pre>
  
  <p>If I execute this query in sqliteman, it works, so why does rusqlite panic?</p>