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
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
[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
[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose
Is xSync guaranteed to be called only once, same as for xClose, if it is then from flush I/O point of view we should be almost no difference. However still xClose releases some resources we would need to know when they fail. Is there a "SQLite" (other than having for example a static variable) way to propagate any error through any other means than modifying SQLite code, e.g. similar to errno, sqlite3_errcode? With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, April 14, 2016 9:41 AM To: SQLite mailing list Subject: Re: [sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose On 4/14/16, Dobrean, Adrian wrote: > > The problem is that when I close there are still I/O operations that > sometimes need to happen, e.g. flush of some buffers, and I need to > know if those operations finished successfully or not. This shouldn't ever come up. xSync should have been called to flush all I/O operations prior to xClose. And the return code from xSync is definitely propagated back up to the application, as that is important. The xClose method is just releasing resources. Kind of like free() in the standard library. Why doesn't standard-library free() return an error code? -- D. Richard Hipp drh at sqlite.org ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose
Thank you. The problem is that when I close there are still I/O operations that sometimes need to happen, e.g. flush of some buffers, and I need to know if those operations finished successfully or not. For example, the close operation fails to flush some of the buffers reports an error that is discarded and the application wouldn't know there is something wrong with the DB. I am not so sure why the error is discarded, even if I make sure the DB is consistent before the close (e.g. flush it to disk), there could be cases where the application may need to know if something wrong during xClose. With best regards, Adrian Dobrean 905-315-4953 -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, April 14, 2016 9:06 AM To: SQLite mailing list Subject: Re: [sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose On 4/14/16, Dobrean, Adrian wrote: > > Is there a way or what should be the proper way to capture the error > returned by sqlite3_io_methods.xClose? > No. It looks like the return value from sqlite3_io_methods.xClose is always ignored and discarded. Why is that a problem? -- D. Richard Hipp drh at sqlite.org ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_close does not propagate the error from sqlite3_io_methods.xClose
Hi, It looks like the error returned by sqlite3_io_methods.xClose is not propagated all the way to sqlite3_close caller. According to a comment in sqlite3_close this function (excepting SQLITE_BUSY) always returns true. Is there a way or what should be the proper way to capture the error returned by sqlite3_io_methods.xClose? With best regards, Adrian Dobrean