Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread James K. Lowden
On Sat, 7 Jan 2017 10:58:56 +0100 gwenn wrote: > After 3.16, > sqlite3_step returns SQLITE_DONE > and > sqlite3_column_count does not return 0 but 6 That is the correct answer. The function returns a set of rows. Every invocation returns the same number of columns. Some

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Sorry, I mean that there are impacts on SQLite wrappers: https://github.com/xerial/sqlite-jdbc/commit/42557128d56da563126003180fd8b8e8978ec818#diff-5a06ee6e8dbd2f4087ab8d361df52832 https://github.com/gwenn/gosqlite/commit/ac9891a74d94fb57679407bd36b80a5be218c6d6

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread Richard Hipp
On 1/7/17, gwenn wrote: > Hello, > You should try executing a PRAGMA with no result such as: > PRAGMA table_info('no_such_table'); > > Before 3.16, > sqlite3_step returns SQLITE_DONE > and > sqlite3_column_count returns 0 > > After 3.16, > sqlite3_step returns SQLITE_DONE >

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-07 Thread gwenn
Hello, You should try executing a PRAGMA with no result such as: PRAGMA table_info('no_such_table'); Before 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count returns 0 After 3.16, sqlite3_step returns SQLITE_DONE and sqlite3_column_count does not return 0 but 6 Regards. On Fri,

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Richard Hipp wrote: > But apparently, many people are looking at the result of > sqlite3_column_count() and if it is zero, they never bother to > sqlite3_finalize() their PRAGMA statements. Or maybe not. I just did an analysis of the sqlite3_column_count() changes

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, kk wrote: > All, > Many thanks for all the replies. It seems that I had now need to run > SQLite3Finalize against the PRAGMA stmts, You should *always* run sqlite3_finalize() on every statement, before you call sqlite3_close(). No exceptions. Pragmas are no

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread kk
On 05/01/2017 23:35, Richard Hipp wrote: On 1/5/17, Kyle wrote: Dear all, Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a database, execute some PRAGMAS, (run some stmts) then attempt the close. This did not occur under version 3.15.2, nor does

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Jens Alfke wrote: > > That would explain the SQLITE_BUSY error — if the pragma returns a non-empty > list of rows, and you’re not reading the rows or resetting the statement, > the statement stays busy and will block closing the database. > There has been a change

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Jens Alfke
> On Jan 5, 2017, at 3:11 PM, Kyle wrote: > > Furthermore the PRAGMAs now seem to return a resultset whereas previously > they did not? Is this expected (or documented)? That would explain the SQLITE_BUSY error — if the pragma returns a non-empty list of rows, and

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 11:30pm, Kyle wrote: > no, the database is :memory: You should not be getting SQLITE_BUSY when using a memory database. So far my guess is the same as DRH’s. Can you tell us how you are executing your SQLite functions ? Are you using the C interface

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Richard Hipp
On 1/5/17, Kyle wrote: > Dear all, > Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open > a database, execute some PRAGMAS, (run some stmts) then attempt the > close. This did not occur under version 3.15.2, nor does it occur under > the new version if

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Kyle
On 05/01/2017 23:14, Simon Slavin wrote: On 5 Jan 2017, at 11:11pm, Kyle wrote: Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a database, execute some PRAGMAS, (run some stmts) then attempt the close. This did not occur under version 3.15.2,

Re: [sqlite] SQLite3Close returns SQLITE_BUSY after executing PRAGMAs

2017-01-05 Thread Simon Slavin
On 5 Jan 2017, at 11:11pm, Kyle wrote: > Under version 3.16.1, SQLite3Close is returning SQLITE_BUSY when I open a > database, execute some PRAGMAS, (run some stmts) then attempt the close. This > did not occur under version 3.15.2, nor does it occur under the new