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):

KMedcalf at WYNPCLLT3 ~
$ rm -rf t1.db*

KMedcalf at WYNPCLLT3 ~
$ sqlite t1.db <<\EOF
> PRAGMA journal_mode=WAL;
> CREATE TABLE t1(a,b,c);
> INSERT INTO t1 VALUES(1,2,3),(4,5,6);
> EOF
wal

KMedcalf at WYNPCLLT3 ~
$ ls -l t1.db*
-rw-r--r-- 1 KMedcalf Administrators 8192 Aug 15 13:12 t1.db

KMedcalf at WYNPCLLT3 ~
$ echo '*******************'
*******************

KMedcalf at WYNPCLLT3 ~
$ sqlite 'file:t1.db?mode=ro' <<\EOF
> SELECT * FROM t1;
> PRAGMA journal_mode;
> .exit 1
> EOF
1|2|3
4|5|6
wal

KMedcalf at WYNPCLLT3 ~
$ ls -l t1.db
-rw-r--r-- 1 KMedcalf Administrators 8192 Aug 15 13:12 t1.db

KMedcalf at WYNPCLLT3 ~
$

Doing similar under CMD.EXE as the shell however results in the following (same 
executable run):

2015-08-15 13:15:15 [D:\Temp]
>sqlite file:test.db?mode=ro
SQLite version 3.8.12 2015-08-15 16:32:50
Enter ".help" for usage hints.
sqlite> select * from test;
1
2
3
sqlite> pragma  journal_mode;
wal
sqlite> .exit


2015-08-15 13:15:54 [D:\Temp]
>dir
 Volume in drive D is DATA
 Volume Serial Number is 343E-C7BF

 Directory of D:\Temp

2015-08-15  13:15    <DIR>          .
2015-08-15  13:15    <DIR>          ..
2015-08-15  12:13    <DIR>          old
2015-08-15  12:34         1,836,032 sqlite3.exe
2015-08-15  12:29             8,192 test.db
2015-08-15  13:15            32,768 test.db-shm
2015-08-15  13:15                 0 test.db-wal
2015-08-15  12:11               151 test.py
2015-08-15  12:12               137 test.sql
2015-08-15  12:16               124 test2.py
               7 File(s)      1,877,404 bytes
               3 Dir(s)  157,980,798,976 bytes free



> -----Original Message-----
> From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-
> bounces at mailinglists.sqlite.org] On Behalf Of Richard Hipp
> Sent: Saturday, 15 August, 2015 12:41
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] journal files not always removed
> 
> On 8/15/15, Keith Medcalf <kmedcalf at dessus.com> wrote:
> >
> > This is something changed in SQLITE itself.  These tests are on Windows
> 10
> > using the current MinGW compiler with the same configuration and windows
> > headers.
> >
> 
> Do you also have MSYS installed?  If so can you run the following
> shell script and see if it demonstrates the problem on Win10?  It does
> not on my Win7 and Win8 boxes.
> 
> 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),(4,5,6);
> EOF
> ls -l t1.db*
> echo '*******************'
> ./sqlite3 'file:t1.db?mode=ro' <<\EOF
> SELECT * FROM t1;
> PRAGMA journal_mode;
> .exit 1
> EOF
> ls -l t1.db
> 
> 
> --
> 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



Reply via email to