[sqlite] Incorrect documentation for PRAGMA table_info (pk column)

2013-04-30 Thread Joey Adams
The documentation for PRAGMA table_info says: The 'pk' column in the result set is zero for columns that are not part of the primary key, and is the index of the column in the primary key for columns that are part of the primary key." But in reality, pk = 1 for all the primary key columns: SQ

Re: [sqlite] [BUG] sqlite3_exec "BEGIN; ROLLBACK" corrupts statement already running

2012-08-23 Thread Joey Adams
On Fri, Aug 24, 2012 at 12:45 AM, Pavel Ivanov wrote: > This is a documented change. See http://www.sqlite.org/releaselog/3_7_11.html: > > "Pending statements no longer block ROLLBACK. Instead, the pending > statement will return SQLITE_ABORT upon next access after the > ROLLBACK." > > There was e

[sqlite] [BUG] sqlite3_exec "BEGIN; ROLLBACK" corrupts statement already running

2012-08-23 Thread Joey Adams
Consider the following operations (full test program attached): stmt <- prepare conn "SELECT * FROM foo" Row <- step stmt exec conn "BEGIN; ROLLBACK" Row <- step stmt Namely, we prepare a statement with sqlite3_prepare_v2, call sqlite3_step (giving us SQLITE_ROW). While the state

[sqlite] Assertion failure when sqlite3_bind_blob is passed a negative length

2012-08-17 Thread Joey Adams
With SQLite 3.7.13 (the current version), if you pass a negative length to sqlite3_bind_blob, you get an assertion failure: sqlite3.c:59949: sqlite3VdbeMemSetStr: Assertion `enc!=0' failed. Here is the relevant source code: ... if( nByte<0 ){ assert( enc!=0 ); if( e