[sqlite] Problems with pragma journal_mode
My xFileControl() method has actually returned a SQLITE_OK and not as stated in the documentation, a SQLITE_NOTFOUND. I fixed it and now all the PRAGMAs worked fine. I thank you very much -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Janke, Julian Sent: Mittwoch, 22. April 2015 13:13 To: ambrus at math.bme.hu; General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode Thank you for the hint. I'll check that. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Zsb?n Ambrus Sent: Mittwoch, 22. April 2015 10:58 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On Wed, Apr 22, 2015 at 10:46 AM, Janke, Julian wrote: > I have tested some of the other pragmas and none worked. After > discussing with you now I come to the conclusion that the problem is > caused more by my local setup. I In that case, as you have a custom vfs, could you check if it's your vfs that is handling those pragmas? The documentation at "http://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpragma; describes that when you run a PRAGMA statement on a database, sqlite will call the xFileControl method of the vfs file handle (as given in a sqlite3_io_methods structure) with SQLITE_FCNTL_PRAGMA as the second parameter. If that method returns SQLITE_OK, then sqlite will assume the vfs has handled the pragma, and will not handle it itself. This could cause pragmas to fail silently. -- Ambrus ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Problems with pragma journal_mode
Okay, thanks for your reply. I had been concerned that it is the only way to implement it by myself in the custom vfs. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Mittwoch, 22. April 2015 12:59 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 4/22/15, Janke, Julian wrote: > The embedded system has various storage media, with different read / > write speeds. > A quick and dirty test shows that the outsourcing of the journal files > on a faster medium may be a significant speed boost. > Is there a possibility to write journal(temporarly) (and later wal > files when I found the error) files to another directory as the main database? > (temp_store_directory is marked as deprecated, and thus seems to be no > option). > You can do this, and get away with it, in the highly controlled environment of a specific embedded application. Just modify your custom VFS to automatically move journal files to a different directory. Or even to give them completely different names. As long as the same journal file always gets the same modified name whenever that name is used, everything should work. Generic SQLite does *NOT* make this an option for a good reason. When recovering from a power loss, it is critical that SQLite be able to check for the existence of and read the journal file, otherwise database corruption may result. If journal files are on a different volume from the database files, then that volume might not be remounted upon reboot, or it might be mounted in a different place, thus preventing SQLite from locating the journal file. We have no way to control this in the general case, except to ensure that journal files are always in exactly the same directory as the database. But you can control this in your highly controlled and constrained environment, and hence you can get away with putting journal files on different volumes from the database. -- 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 Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Thank you for the hint. I'll check that. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Zsb?n Ambrus Sent: Mittwoch, 22. April 2015 10:58 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On Wed, Apr 22, 2015 at 10:46 AM, Janke, Julian wrote: > I have tested some of the other pragmas and none worked. After > discussing with you now I come to the conclusion that the problem is > caused more by my local setup. I In that case, as you have a custom vfs, could you check if it's your vfs that is handling those pragmas? The documentation at "http://sqlite.org/c3ref/c_fcntl_busyhandler.html#sqlitefcntlpragma; describes that when you run a PRAGMA statement on a database, sqlite will call the xFileControl method of the vfs file handle (as given in a sqlite3_io_methods structure) with SQLITE_FCNTL_PRAGMA as the second parameter. If that method returns SQLITE_OK, then sqlite will assume the vfs has handled the pragma, and will not handle it itself. This could cause pragmas to fail silently. -- Ambrus ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
I have tested some of the other pragmas and none worked. After discussing with you now I come to the conclusion that the problem is caused more by my local setup. I had hoped to be able to avoid it, but I will now try to debug the database and find the error. If I find the error, I will report you. However, I have one more question: The embedded system has various storage media, with different read / write speeds. A quick and dirty test shows that the outsourcing of the journal files on a faster medium may be a significant speed boost. Is there a possibility to write journal(temporarly) (and later wal files when I found the error) files to another directory as the main database? (temp_store_directory is marked as deprecated, and thus seems to be no option). Thansk a lot or your help -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Montag, 20. April 2015 16:32 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode If the compile-time options you have shown are complete, then the PRAGMA command ought to be working. But clearly PRAGMA is not working. Can you do an experimental build that omits all of your -DSQLITE options and see if "PRAGMA journal_mode;" and "PRAGMA compile_options;" work then? What about other PRAGMAs, like "PRAGMA database_list;" and "PRAGMA table_info=TABLE;". See the complete list at (https://www.sqlite.org/pragma.html#toc). Are any pragmas working on your system? On 4/20/15, Janke, Julian wrote: > I'm pretty sure that they are completely. Later this discussion I > added > -DSQLITE_DEFAULT_LOCKING_MODE=1 > > There are only a few non-SQLite-specific options still available. > Tell me if I'm wrong, but I do not think that are the cause of my problem. > > -mcpu=603e > -fno-common > -msdata=none > -fno-jump-tables > -fno-section-anchors > -fno-merge-constants > -fno-builtin > -nostdlib > -Werror-implicit-function-declaration > -Wconversion > -fstack-usage > -std=c99 > -c > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of > Richard Hipp > Sent: Montag, 20. April 2015 15:55 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Problems with pragma journal_mode > > On 4/20/15, Janke, Julian wrote: >> >> PRAGMA compile_options; shows 0 > > This makes me think that the list of compile-time options you showed > us earlier is incomplete: > > -DSQLITE_ENABLE_MEMSYS5 > -DSQLITE_ENABLE_8_3_NAMES=2 > -DSQLITE_THREADSAFE=0 > -DSQLITE_OS_OTHER=1 > -DSQLITE_ENABLE_API_ARMOR > -DSQLITE_DEFAULT_MMAP_SIZE=0 > -DSQLITE_TEMP_STORE=0 > -DSQLITE_DEFAULT_CACHE_SIZE=500 > > Please double-check to ensure that you do not have additional SQLITE > defines stuck in a configuration file someplace. > >> >> >> -Original Message- >> From: sqlite-users-bounces at mailinglists.sqlite.org >> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of >> Richard Hipp >> Sent: Montag, 20. April 2015 12:18 >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Problems with pragma journal_mode >> >> On 4/20/15, Janke, Julian wrote: >>> 'EXPLAIN PRAGMA journal_mode=WAL' returns 2 rows >>> >>> 0: 0 Init 0 0 0 >>> 1: 1 Halt 0 0 0 >>> >> >> You should get this: >> >> addr opcode p1p2p3p4 p5 comment >> - - -- - >> 0 Init 0 0 000 >> 1 JournalMode0 1 500 >> 2 ResultRow 1 1 000 >> 3 Halt 0 0 000 >> >> What does: "PRAGMA compile_options;" and "SELECT sqlite_source_id();" >> show? >> >> >> >>> Is it the result of what you expected? >>> >>> -Original Message- >>> From: sqlite-users-bounces at mailinglists.sqlite.org >>> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of >>> Richard Hipp >>> Sent: Freitag, 17. April 2015 16:59 >>> To: General Discussion of SQLite Database >>> Subject: Re: [sqlite] Problems with pragma journal_mode >>> >>> On 4/17/15, Janke, Julian wrote: >>>> Hello, >>>> Thanks for your reply. >>>> >>>> I changed my code again: >>>> >
[sqlite] Problems with pragma journal_mode
I'm pretty sure that they are completely. Later this discussion I added -DSQLITE_DEFAULT_LOCKING_MODE=1 There are only a few non-SQLite-specific options still available. Tell me if I'm wrong, but I do not think that are the cause of my problem. -mcpu=603e -fno-common -msdata=none -fno-jump-tables -fno-section-anchors -fno-merge-constants -fno-builtin -nostdlib -Werror-implicit-function-declaration -Wconversion -fstack-usage -std=c99 -c -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Montag, 20. April 2015 15:55 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 4/20/15, Janke, Julian wrote: > > PRAGMA compile_options; shows 0 This makes me think that the list of compile-time options you showed us earlier is incomplete: -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_8_3_NAMES=2 -DSQLITE_THREADSAFE=0 -DSQLITE_OS_OTHER=1 -DSQLITE_ENABLE_API_ARMOR -DSQLITE_DEFAULT_MMAP_SIZE=0 -DSQLITE_TEMP_STORE=0 -DSQLITE_DEFAULT_CACHE_SIZE=500 Please double-check to ensure that you do not have additional SQLITE defines stuck in a configuration file someplace. > > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of > Richard Hipp > Sent: Montag, 20. April 2015 12:18 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Problems with pragma journal_mode > > On 4/20/15, Janke, Julian wrote: >> 'EXPLAIN PRAGMA journal_mode=WAL' returns 2 rows >> >> 0: 0 Init 0 0 0 >> 1: 1 Halt 0 0 0 >> > > You should get this: > > addr opcode p1p2p3p4 p5 comment > - - -- - > 0 Init 0 0 000 > 1 JournalMode0 1 500 > 2 ResultRow 1 1 000 > 3 Halt 0 0 000 > > What does: "PRAGMA compile_options;" and "SELECT sqlite_source_id();" show? > > > >> Is it the result of what you expected? >> >> -Original Message- >> From: sqlite-users-bounces at mailinglists.sqlite.org >> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of >> Richard Hipp >> Sent: Freitag, 17. April 2015 16:59 >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Problems with pragma journal_mode >> >> On 4/17/15, Janke, Julian wrote: >>> Hello, >>> Thanks for your reply. >>> >>> I changed my code again: >>> >>> 1) rc = sqlite3_open(dbPath, ); --> SQLITE_OK >>> 2) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", >>> testCallbackPrint, 0, ); >>> 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, >>> , NULL); >>> --> SQLITE_OK >>> 4) rc = sqlite3_step(stmt); --> SQLITE_DONE >> >> I do not understand this. "PRAGMA journal_mode" should always give a >> return value, even when it fails. sqlite3_step() should have >> returned SQLITE_ROW. >> >> Please try instead, "EXPLAIN PRAGMA journal_mode=WAL". Verify that >> you get multiple rows of output in that case. >> >> >>> 5) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", >>> testCallbackPrint, 0, ); >>> 6) txt = sqlite3_column_text (stmt, 0); --> returns an empty string >>> 7) rc = sqlite3_finalize(stmt); --> SQLITE_OK >>> 8) rc = sqlite3_close(db); --> SQLITE_OK >>> >>> Repeated the same steps with >>> >>> 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode;", 24, , >>> NULL); --> SQLITE_OK >>> >>> To my knowledge, at line 4 SQLITE_ROW instead of SQLITE_DONE should >>> be returned. >>> >>> "These routines may only be called when the most recent call to >>> sqlite3_step() has returned SQLITE_ROW and neither sqlite3_reset() >>> nor >>> sqlite3_finalize() have been called subsequently." >>> >>> It looks as if all PRAGMA instructions are completely ignored, since >>> the query for the status of the JOURNAL_MODE returns no result. >>> >>> Is it possible that I have turned off PRAMAs by anything or >>> something is missing, so PRAMAs can run? >>> >>> Thanks for your help >>> >>> >>> -Original Message--
[sqlite] Problems with pragma journal_mode
SELECT sqlite_source_id(); shows: 2015-02-25 13:29:11 9d6c1880fb75660bbabd693175579529785f8a6b And PRAGMA compile_options; shows 0 -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Montag, 20. April 2015 12:18 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 4/20/15, Janke, Julian wrote: > 'EXPLAIN PRAGMA journal_mode=WAL' returns 2 rows > > 0: 0 Init 0 0 0 > 1: 1 Halt 0 0 0 > You should get this: addr opcode p1p2p3p4 p5 comment - - -- - 0 Init 0 0 000 1 JournalMode0 1 500 2 ResultRow 1 1 000 3 Halt 0 0 000 What does: "PRAGMA compile_options;" and "SELECT sqlite_source_id();" show? > Is it the result of what you expected? > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of > Richard Hipp > Sent: Freitag, 17. April 2015 16:59 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Problems with pragma journal_mode > > On 4/17/15, Janke, Julian wrote: >> Hello, >> Thanks for your reply. >> >> I changed my code again: >> >> 1) rc = sqlite3_open(dbPath, ); --> SQLITE_OK >> 2) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", >> testCallbackPrint, 0, ); >> 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , >> NULL); >> --> SQLITE_OK >> 4) rc = sqlite3_step(stmt); --> SQLITE_DONE > > I do not understand this. "PRAGMA journal_mode" should always give a > return value, even when it fails. sqlite3_step() should have returned > SQLITE_ROW. > > Please try instead, "EXPLAIN PRAGMA journal_mode=WAL". Verify that > you get multiple rows of output in that case. > > >> 5) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", >> testCallbackPrint, 0, ); >> 6) txt = sqlite3_column_text (stmt, 0); --> returns an empty string >> 7) rc = sqlite3_finalize(stmt); --> SQLITE_OK >> 8) rc = sqlite3_close(db); --> SQLITE_OK >> >> Repeated the same steps with >> >> 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode;", 24, , >> NULL); --> SQLITE_OK >> >> To my knowledge, at line 4 SQLITE_ROW instead of SQLITE_DONE should >> be returned. >> >> "These routines may only be called when the most recent call to >> sqlite3_step() has returned SQLITE_ROW and neither sqlite3_reset() >> nor >> sqlite3_finalize() have been called subsequently." >> >> It looks as if all PRAGMA instructions are completely ignored, since >> the query for the status of the JOURNAL_MODE returns no result. >> >> Is it possible that I have turned off PRAMAs by anything or something >> is missing, so PRAMAs can run? >> >> Thanks for your help >> >> >> -Original Message- >> From: sqlite-users-bounces at mailinglists.sqlite.org >> [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of >> Simon Slavin >> Sent: Donnerstag, 16. April 2015 17:56 >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Problems with pragma journal_mode >> >> >> On 16 Apr 2015, at 2:33pm, Janke, Julian >> wrote: >> >>> rc = sqlite3_step(stmt); >>> --> returns SQLITE_DONE >> >> After the above two lines, print the value returned by >> >> sqlite3_column_text(stmt, 0) >> >> I'm not good at C off the top of my head but I think it's something >> like >> >> - >> >> const unsigned char * theText; >> >> [...] >> >> rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , >> NULL); >> >> rc = sqlite3_step(stmt); >> theText = sqlite3_column_text (stmt, 0); printf ("text returned: >> %s", theText); >> >> rc = sqlite3_finalize(stmt); >> >> - >> >> Hope if I got it wrong someone else will tell you. By the way, you >> can also check the values returned from sqlite3_finalize() and >> sqlite3_close() since they can tell you useful things if something >> went wrong. >> >> Simon. >>
[sqlite] Problems with pragma journal_mode
'EXPLAIN PRAGMA journal_mode=WAL' returns 2 rows 0: 0 Init 0 0 0 1: 1 Halt 0 0 0 Is it the result of what you expected? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Freitag, 17. April 2015 16:59 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 4/17/15, Janke, Julian wrote: > Hello, > Thanks for your reply. > > I changed my code again: > > 1) rc = sqlite3_open(dbPath, ); --> SQLITE_OK > 2) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", > testCallbackPrint, 0, ); > 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , > NULL); > --> SQLITE_OK > 4) rc = sqlite3_step(stmt); --> SQLITE_DONE I do not understand this. "PRAGMA journal_mode" should always give a return value, even when it fails. sqlite3_step() should have returned SQLITE_ROW. Please try instead, "EXPLAIN PRAGMA journal_mode=WAL". Verify that you get multiple rows of output in that case. > 5) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", > testCallbackPrint, 0, ); > 6) txt = sqlite3_column_text (stmt, 0); --> returns an empty string > 7) rc = sqlite3_finalize(stmt); --> SQLITE_OK > 8) rc = sqlite3_close(db); --> SQLITE_OK > > Repeated the same steps with > > 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode;", 24, , > NULL); --> SQLITE_OK > > To my knowledge, at line 4 SQLITE_ROW instead of SQLITE_DONE should be > returned. > > "These routines may only be called when the most recent call to > sqlite3_step() has returned SQLITE_ROW and neither sqlite3_reset() nor > sqlite3_finalize() have been called subsequently." > > It looks as if all PRAGMA instructions are completely ignored, since > the query for the status of the JOURNAL_MODE returns no result. > > Is it possible that I have turned off PRAMAs by anything or something > is missing, so PRAMAs can run? > > Thanks for your help > > > -Original Message- > From: sqlite-users-bounces at mailinglists.sqlite.org > [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of > Simon Slavin > Sent: Donnerstag, 16. April 2015 17:56 > To: General Discussion of SQLite Database > Subject: Re: [sqlite] Problems with pragma journal_mode > > > On 16 Apr 2015, at 2:33pm, Janke, Julian > wrote: > >> rc = sqlite3_step(stmt); >> --> returns SQLITE_DONE > > After the above two lines, print the value returned by > > sqlite3_column_text(stmt, 0) > > I'm not good at C off the top of my head but I think it's something > like > > - > > const unsigned char * theText; > > [...] > > rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , > NULL); > > rc = sqlite3_step(stmt); > theText = sqlite3_column_text (stmt, 0); printf ("text returned: %s", > theText); > > rc = sqlite3_finalize(stmt); > > - > > Hope if I got it wrong someone else will tell you. By the way, you > can also check the values returned from sqlite3_finalize() and > sqlite3_close() since they can tell you useful things if something went wrong. > > Simon. > ___ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > > > > Firma: Capgemini Deutschland GmbH > Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. > Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. > Volkmar Varnhagen > > Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains > information that may be privileged or confidential and is the property > of the Capgemini Group. It is intended only for the person to whom it > is addressed. If you are not the intended recipient, you are not > authorized to read, print, retain, copy, disseminate, distribute, or > use this message or any part thereof. If you receive this message in > error, please notify the sender immediately and delete all copies of this > message. > ___ > sqlite-users mailing list > sqlite-users at mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > -- 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 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Unfortunately not. There are no shell on the system to which I have access as an application developer, so I don't can run executables. The only thing I can do is to download c-code applications on a given interface to the board. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Dominique Devienne Sent: Freitag, 17. April 2015 13:50 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On Fri, Apr 17, 2015 at 12:59 PM, Janke, Julian wrote: > Unfortunately, I can't run the shell tool on the es and try the same > sequence of commands. > Why? Don't you have some kind of shell on that embedded system that can run executables? According to https://www.sqlite.org/howtocompile.html, the amalgamation also comes with shell.c, the source code for the SQLite shell, and you can compile it into an exe with your VFS, and then easily test everything at the command line of the board/embedded OS. --DD ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Yes, I downloaded the amalgamation and included it into my project. Since it is an embedded system with a not out of the box supported operating system, I wrote my own vfs. Insert, select, delete operations properly work on a database and as desired. I've changed the stmt to "SELECT 'Hello World !!';" In this case, sqlite3_step() returns SQLITE_ROW sqlite3_column_text() returns 'Hello World !!' That, looks right. Unfortunately, I can't run the shell tool on the es and try the same sequence of cammands. If you think that there's something wrong with the compilation process, should then also standard SQL instructions do not work? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Freitag, 17. April 2015 12:34 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 17 Apr 2015, at 11:12am, Janke, Julian wrote: > I changed my code again: Move the DROP TABLE command on line 5 to after the _finalize() call. But I don't think it'll make any difference. You should not be getting SQLITE_DONE back from your call to _step(). The documentation says that that PRAGMA command should return a row of data. Please try changing the PRAMGA command to sqlite3_prepare_v2(db, "SELECT 'Hello World !!';", 24, , NULL); and see what you get back from it. > It looks as if all PRAGMA instructions are completely ignored, since > the query for the status of the JOURNAL_MODE returns no result. > > Is it possible that I have turned off PRAMAs by anything or something is > missing, so PRAMAs can run? No. I'm coming to the conclusion that there's something wrong with your compilation process. How are you getting your sqlite3 library ? Have you downloaded the amalgamation source code and included it in your project ? If not, please try doing this. Can you download the sqlite3 shell tool and try the same sequence of commands ? You can find it here: <https://www.sqlite.org/download.html> Simon. ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Hello, Thanks for your reply. I changed my code again: 1) rc = sqlite3_open(dbPath, ); --> SQLITE_OK 2) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", testCallbackPrint, 0, ); 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , NULL); --> SQLITE_OK 4) rc = sqlite3_step(stmt); --> SQLITE_DONE 5) rc = sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", testCallbackPrint, 0, ); 6) txt = sqlite3_column_text (stmt, 0); --> returns an empty string 7) rc = sqlite3_finalize(stmt); --> SQLITE_OK 8) rc = sqlite3_close(db); --> SQLITE_OK Repeated the same steps with 3) rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode;", 24, , NULL); --> SQLITE_OK To my knowledge, at line 4 SQLITE_ROW instead of SQLITE_DONE should be returned. "These routines may only be called when the most recent call to sqlite3_step() has returned SQLITE_ROW and neither sqlite3_reset() nor sqlite3_finalize() have been called subsequently." It looks as if all PRAGMA instructions are completely ignored, since the query for the status of the JOURNAL_MODE returns no result. Is it possible that I have turned off PRAMAs by anything or something is missing, so PRAMAs can run? Thanks for your help -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Donnerstag, 16. April 2015 17:56 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 16 Apr 2015, at 2:33pm, Janke, Julian wrote: > rc = sqlite3_step(stmt); > --> returns SQLITE_DONE After the above two lines, print the value returned by sqlite3_column_text(stmt, 0) I'm not good at C off the top of my head but I think it's something like - const unsigned char * theText; [...] rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , NULL); rc = sqlite3_step(stmt); theText = sqlite3_column_text (stmt, 0); printf ("text returned: %s", theText); rc = sqlite3_finalize(stmt); - Hope if I got it wrong someone else will tell you. By the way, you can also check the values returned from sqlite3_finalize() and sqlite3_close() since they can tell you useful things if something went wrong. Simon. ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Ok, actually I'm a little bit confused, never used prepare(), step() and finalize() manually before. Maybe it's his absolute basics are missing me here, but maybe someone can still help me On which point I should get "wal" back? I changed my code to the following: rc = sqlite3_open(dbPath, ); sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", testCallbackPrint, 0, ); rc = sqlite3_prepare_v2(db, "PRAGMA journal_mode=WAL;", 24, , NULL); --> returns SQLITE_OK rc = sqlite3_step(stmt); --> returns SQLITE_DONE sqlite3_finalize(stmt); sqlite3_exec(db, "DROP TABLE IF EXISTS nosuchtable;", testCallbackPrint, 0, ); [...] sqlite3_close(db); Thanks. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Slavin Sent: Donnerstag, 16. April 2015 14:15 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 16 Apr 2015, at 10:10am, Janke, Julian wrote: > rc = sqlite3_open(dbPath, ); > rc = sqlite3_exec(db, "PRAGMA journal_mode=WAL;", testCallbackPrint, > 0, ); [?] sqlite3_close(db); Execute your PRAGMA as if it's a SELECT call (i.e. use sqlite3_prepare_v2(), sqlite3_step(), and sqlite3_finalize()) and check the value returned by _step(). If the command worked you should get "wal" back. Before and after your existing PRAGMA, submit any SQL command that needs database access. For example DROP TABLE IF EXISTS nosuchtable; PRAGMA journal_mode=WAL; DROP TABLE IF EXISTS nosuchtable; You can use _exec() for these other commands. I do not know that this is definitely your problem, but I seem to remember that there has to be some kind of file access for a journal mode change to take effect. In connection with another post to this thread, you should be able to change the journal mode at any time you have the only connection to the database. This includes changing between traditional journal modes and WAL mode. Simon. ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
No there are no mmap support in the vfs. So I need also -DSQLITE_DEFAULT_LOCKING_MODE=1 in my compile time options, right? Recompile and retested it, but still the same behavior (also on an empty new db). I am surprised that sqlite3_exec(db, "PRAGMA journal_mode;", testCallbackPrint, 0, ); has absolutly no effect. Should I not get at least the default journal mode as answer? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Clemens Ladisch Sent: Donnerstag, 16. April 2015 11:23 To: sqlite-users at mailinglists.sqlite.org Subject: Re: [sqlite] Problems with pragma journal_mode Janke, Julian wrote: > PRAGMA journal_mode=WAL; > > Unfortunately, after these lines, the journal mode is not changed. > > -DSQLITE_OS_OTHER=1 Do you have mmap support? <http://www.sqlite.org/wal.html> says: | WAL normally requires that the VFS support shared-memory primitives. | The built-in unix and windows VFSes support this but third-party | extension VFSes for custom operating systems might not. But <http://www.sqlite.org/wal.html#noshm> says: | Use of WAL Without Shared-Memory | | Beginning in SQLite version 3.7.4, WAL databases can be created, read, | and written even if shared memory is unavailable as long as the | locking_mode is set to EXCLUSIVE before the first attempted access. In | other words, a process can interact with a WAL database without using | shared memory if that process is guaranteed to be the only process | accessing the database. This feature allows WAL databases to be | created, read, and written by legacy VFSes that lack the "version 2" | shared-memory methods xShmMap, xShmLock, xShmBarrier, and xShmUnmap on | the sqlite3_io_methods object. Regards, Clemens ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
I use the version SQLITE_VERSION "3.8.8.3" -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Simon Davies Sent: Donnerstag, 16. April 2015 11:20 To: General Discussion of SQLite Database Subject: Re: [sqlite] Problems with pragma journal_mode On 16 April 2015 at 10:10, Janke, Julian wrote: > Hi everyone, > > I'm relatively new to SQLite and currently I'm experimenting a little bit > with the SQLite database on an embedded system. > I want to change the journal mode of a database to WAL. So I did the > following: > > rc = sqlite3_open(dbPath, ); > rc = sqlite3_exec(db, "PRAGMA journal_mode=WAL;", testCallbackPrint, > 0, ); [?] sqlite3_close(db); > > Unfortunately, after these lines, the journal mode is not changed. The > sqlite3_exec function returns SQLITE_OK (0), testCallbackPrint is never > called and the error message is empty. > Also reading the value of journal mode with ?PRAGMA journal_mode;? leads to > the same result (rc=0, callback noch called and error message is empty). What version of SQLite? ... > > Thanks. Regards, Smon ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Problems with pragma journal_mode
Hi everyone, I'm relatively new to SQLite and currently I'm experimenting a little bit with the SQLite database on an embedded system. I want to change the journal mode of a database to WAL. So I did the following: rc = sqlite3_open(dbPath, ); rc = sqlite3_exec(db, "PRAGMA journal_mode=WAL;", testCallbackPrint, 0, ); [?] sqlite3_close(db); Unfortunately, after these lines, the journal mode is not changed. The sqlite3_exec function returns SQLITE_OK (0), testCallbackPrint is never called and the error message is empty. Also reading the value of journal mode with ?PRAGMA journal_mode;? leads to the same result (rc=0, callback noch called and error message is empty). It seems as if the pragma is ignored completely, so I tested other pragmas, with the same result. So what am I doing wrong? To compile, I use the following options -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_ENABLE_8_3_NAMES=2 -DSQLITE_THREADSAFE=0 -DSQLITE_OS_OTHER=1 -DSQLITE_ENABLE_API_ARMOR -DSQLITE_DEFAULT_MMAP_SIZE=0 -DSQLITE_TEMP_STORE=0 -DSQLITE_DEFAULT_CACHE_SIZE=500 Thanks. Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder ? Gesch?ftsf?hrer: Dr. Michael Schulte (Sprecher) ? Jost F?rster ? Dr. Peter Lempp ? Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
[sqlite] Porting SQLite to another operating system (not supported out of the box)
Hello, we plan to port the SQLite library on an embedded system, which runs on a platform other than the ones that are supported out of the box (it’s an SMX based system). For the first step, we don’t need a working mutex subsystem, because we have no multithreaded environment. The required standard c library functions memset(), memcpy(), memcmp(), strcmp(), malloc(), free() and realloc() are available. In my opinion, this means, we must ""only"" write a VFS implementation for our target platform. So my question is, if there is any additional information, how to write a VFS? Or does anyone have a clue how to start best? I know there are two implementations for unix and windows systems in os_unix.c and os_win.c, but these are very large files, which are not very helpful for a first rough understanding. Regards, Julian Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder • Geschäftsführer: Dr. Michael Schulte (Sprecher) • Jost Förster • Dr. Peter Lempp • Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Porting SQLite to another operating system (not supported out of the box)
Firma: Capgemini Deutschland GmbH Aufsichtsratsvorsitzender: Antonio Schnieder • Geschäftsführer: Dr. Michael Schulte (Sprecher) • Jost Förster • Dr. Peter Lempp • Dr. Volkmar Varnhagen Amtsgericht Berlin-Charlottenburg, HRB 98814 This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users