On 8/15/15, Keith Medcalf <kmedcalf at dessus.com> wrote:
>
> Quite Fascinating! Here is the transcript (it is running the Windows
> SQLITE.EXE which I have in a different location in the path, so slightly
> modified the script):
>

Ugh.  There is a bug in my script.  The final "ls -l" should have a
"*" at the end....

Revised script:

rm -rf t1.db*
./sqlite3 t1.db <<\EOF
PRAGMA journal_mode=WAL;
CREATE TABLE t1(a,b,c);
INSERT INTO t1 VALUES(1,2,3);
INSERT INTO t1 VALUES(4,5,6);
EOF
ls -l t1.db*
echo '*******************'
./sqlite3 'file:t1.db?mode=ro' <<\EOF
SELECT * FROM t1;
PRAGMA journal_mode;
EOF
ls -l t1.db*
echo '*******************'
./sqlite3 'file:t1.db?mode=rw' <<\EOF
SELECT * FROM t1;
PRAGMA journal_mode;
EOF
ls -l t1.db*

With this new test case, I see that the -shm and -wal files are
retained upon exit in read-only mode.  But I also see that behavior
dates back to 3.7.6 and maybe earlier.  It isn't something new.
(Testing on Ubuntu).

-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to