title: Python sqlite3 module returning incorrect rowid values when inserting record
body: <p>I'm having a very peculiar problem with Python's sqlite3 module - and even more oddly, it only occurs with one particular table, but it occurs with that table whichever database it's in.  </p>
  
  <p>So, I create a table in an sqlite3 database with the following:</p>
  
  <pre><code>CREATE TABLE BlockedNumbers (MobileNumber integer PRIMARY KEY NOT NULL, BlockedTimes integer);
  </code></pre>
  
  <p>Then run this in Python:</p>
  
  <pre><code>import sqlite3
  conn = sqlite3.connect('/tmp/test.db',isolation_level=None, detect_types=sqlite3.PARSE_DECLTYPES);
  sqliteobj = conn.cursor()
  sqliteobj.execute("INSERT INTO BlockedNumbers (MobileNumber,BlockedTimes) VALUES ('9999999999','1');")
  print sqliteobj.lastrowid
  </code></pre>
  
  <p>According to <a href="https://sqlite.org/autoinc.html" rel="nofollow">the sqlite documentation</a>:</p>
  
  <blockquote>
    <p>If a table contains a column of type INTEGER PRIMARY KEY, then that column becomes an alias for the ROWID. You can then access the ROWID using any of four different names, the original three names described above or the name given to the INTEGER PRIMARY KEY column. </p>
  </blockquote>
  
  <p>So in this case, we would expect to get a rowid of 9999999999, and indeed that is precisely what I get if I run <code>select last_insert_rowid();</code> in the sqlite3 shell.  But in Python I get:</p>
  
  <pre><code>1283723252
  </code></pre>
  
  <p>or all kinds of random numbers, including negative ones.  This happens even with a clean, new database if this particular table is created.  </p>
  
  <p>This is Python 2.6.6, which I'm running as I am using it with a script that runs under <a href="http://code.google.com/android-scripting" rel="nofollow">SL4A</a>.  Is this a bug?  I can't find any references to this kind of behaviour.  </p>