Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
On Tue, Jul 5, 2016 at 4:46 PM, Dobrean, Adrianwrote: > I am unable to turn off journal for vfs (I am using SQLite version 3.8.7.2). > I am not getting any error and the journal mode does not get set (i.e. to > PAGER_JOURNALMODE_OFF). > Any idea what am I doing wrong? (it used to work in 3.7.5) > > > sqlite3_open_v2("/path/mysqfile", , SQLITE_OPEN_READWRITE | > SQLITE_OPEN_CREATE, "myvfs"); > sqlite3_exec(ddDB, "PRAGMA journal_mode = off",NULL, 0, ); > On Tue, Jul 5, 2016 at 5:05 PM, Dobrean, Adrian wrote: > I am not getting any error, i.e. sqlite3_exec returns 0 and zErrMsg is NULL. If you define your custom vfs, make sure to check what your xFileControl method (in the sqlite3_io_methods structure) does when called with SQLITE_FCNTL_PRAGMA as its second argument. This vfs method can override pragmas that should normally be handled by the sqlite3 core, not the vfs. See https://www.sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpragma for documentation. -- Ambrus ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
On 2016/07/05 5:18 PM, Dobrean, Adrian wrote: My understanding is that as result of this command " PRAGMA journal_mode = off" the journal mode should get set to "PAGER_JOURNALMODE_OFF". However in my case even though I get no error and the journal_mode stays set to "0" instead of "PAGER_JOURNALMODE_OFF " (which is 2). That's easy then - your understanding is wrong! The return value of that statement (assuming you check the return value of sqlite3_exec()) is an SQLite error code to say whether or not the statement succeeded (which I think 0 means it did succeed) and has nothing to do with the new Journal mode. You can now run a second statement being simply "PRAGMA journal_mode;" which should return again a normal SQLite error code to show the statement succeeded using the standard api sqlite3_prepareV2() or similar to get a prepared statement (like all other SQL SELECT queries that you have) and this time hopefully the error code returned would be indicating it has one row to read, (I think 101) and then reading the value of that single row and single field returned (as a query record set) will now give the value of what the new journal mode is. Do not confuse the API functions' C-language return values with a result set returned for an SQL cursor / query row/column set - they are not the same thing. That's about as verbose as I can make it - I hope it helps! ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
I am not sure if this is relevant but sqlite3_prepare_v2 build a statement with 0 columns, i.e. pVm->nResColumn = 0; Also the operation code of the prepared statement shows OP_Init (153) instead of OP_JournalMode (12). Again here you have my exec statement: " sqlite3_exec(ddDB, "PRAGMA journal_mode = off",NULL, 0, ); " With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Dobrean, Adrian Sent: Tuesday, July 05, 2016 11:19 AM To: SQLite mailing list Subject: Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs My understanding is that as result of this command " PRAGMA journal_mode = off" the journal mode should get set to "PAGER_JOURNALMODE_OFF". However in my case even though I get no error and the journal_mode stays set to "0" instead of "PAGER_JOURNALMODE_OFF " (which is 2). Basically I need to turn off the journaling for this database. With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, July 05, 2016 11:13 AM To: SQLite mailing list Subject: Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs On 5 Jul 2016, at 4:05pm, Dobrean, Adrian <adrian.dobr...@emc.com> wrote: > I am not getting any error, i.e. sqlite3_exec returns 0 and zErrMsg is NULL. That indicates your command worked correctly. What makes you think your command is failing ? After executing PRAGMA journal_mode = off please execute PRAGMA journal_mode and tell us what value is in the table the command returns. It should tell you what setting journal_mode has now. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
My understanding is that as result of this command " PRAGMA journal_mode = off" the journal mode should get set to "PAGER_JOURNALMODE_OFF". However in my case even though I get no error and the journal_mode stays set to "0" instead of "PAGER_JOURNALMODE_OFF " (which is 2). Basically I need to turn off the journaling for this database. With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Tuesday, July 05, 2016 11:13 AM To: SQLite mailing list Subject: Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs On 5 Jul 2016, at 4:05pm, Dobrean, Adrian <adrian.dobr...@emc.com> wrote: > I am not getting any error, i.e. sqlite3_exec returns 0 and zErrMsg is NULL. That indicates your command worked correctly. What makes you think your command is failing ? After executing PRAGMA journal_mode = off please execute PRAGMA journal_mode and tell us what value is in the table the command returns. It should tell you what setting journal_mode has now. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
On 5 Jul 2016, at 4:05pm, Dobrean, Adrianwrote: > I am not getting any error, i.e. sqlite3_exec returns 0 and zErrMsg is NULL. That indicates your command worked correctly. What makes you think your command is failing ? After executing PRAGMA journal_mode = off please execute PRAGMA journal_mode and tell us what value is in the table the command returns. It should tell you what setting journal_mode has now. Simon. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
I am not getting any error, i.e. sqlite3_exec returns 0 and zErrMsg is NULL. Also I forgot to mention that "/path/mysqfile" is an empty file. With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-boun...@mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Tuesday, July 05, 2016 11:02 AM To: SQLite mailing list Subject: Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs On 7/5/16, Dobrean, Adrian <adrian.dobr...@emc.com> wrote: > Hi, > > I am unable to turn off journal for vfs (I am using SQLite version > 3.8.7.2). > I am not getting any error and the journal mode does not get set (i.e. > to PAGER_JOURNALMODE_OFF). Maybe you could tell us what the error is? > Any idea what am I doing wrong? (it used to work in 3.7.5) > > " > sqlite3_open_v2("/path/mysqfile", , SQLITE_OPEN_READWRITE | > SQLITE_OPEN_CREATE, "myvfs"); sqlite3_exec(ddDB, "PRAGMA journal_mode > = off",NULL, 0, ); " > > With best regards, > > Adrian Dobrean > 905-315-4953 > > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
On 7/5/16, Dobrean, Adrianwrote: > Hi, > > I am unable to turn off journal for vfs (I am using SQLite version > 3.8.7.2). > I am not getting any error and the journal mode does not get set (i.e. to > PAGER_JOURNALMODE_OFF). Maybe you could tell us what the error is? > Any idea what am I doing wrong? (it used to work in 3.7.5) > > " > sqlite3_open_v2("/path/mysqfile", , SQLITE_OPEN_READWRITE | > SQLITE_OPEN_CREATE, "myvfs"); > sqlite3_exec(ddDB, "PRAGMA journal_mode = off",NULL, 0, ); > " > > With best regards, > > Adrian Dobrean > 905-315-4953 > > ___ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] unable to set 'PRAGMA journal_mode = off' for vfs
Hi, I am unable to turn off journal for vfs (I am using SQLite version 3.8.7.2). I am not getting any error and the journal mode does not get set (i.e. to PAGER_JOURNALMODE_OFF). Any idea what am I doing wrong? (it used to work in 3.7.5) " sqlite3_open_v2("/path/mysqfile", , SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, "myvfs"); sqlite3_exec(ddDB, "PRAGMA journal_mode = off",NULL, 0, ); " With best regards, Adrian Dobrean 905-315-4953 ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users