Do not delete the journal file in "PRAGMA journal_mode" commands. This fixes [fc62af4523].

FossilOrigin-Name: 1ec74591a93e8b27ad3ac739914a48a91972e82c
This commit is contained in:
dan 2010-06-17 10:42:06 +00:00
parent cb0a7a7267
commit 7c6d618615
4 changed files with 10 additions and 24 deletions

View File

@ -1,5 +1,5 @@
C Add\stest\scase\sfor\s[fc62af4523].
D 2010-06-17T10:24:28
C Do\snot\sdelete\sthe\sjournal\sfile\sin\s"PRAGMA\sjournal_mode"\scommands.\sThis\sfixes\s[fc62af4523].
D 2010-06-17T10:42:07
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in a5cad1f8f3e021356bfcc6c77dc16f6f1952bbc3
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -156,7 +156,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f
F src/os_os2.c 665876d5eec7585226b0a1cf5e18098de2b2da19
F src/os_unix.c ae173c9f6afaa58b2833a1c95c6cd32021755c42
F src/os_win.c dfde7d33c446e89dd9a277c036f2c4cc564b3138
F src/pager.c 7f0ebd5dca02cda61a5ee2cc8d6877286592abda
F src/pager.c b5584c5e75e463b4a136e26858d555e83ca97b44
F src/pager.h ca1f23c0cf137ac26f8908df2427c8b308361efd
F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e
F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07
@ -466,7 +466,7 @@ F test/join4.test 1a352e4e267114444c29266ce79e941af5885916
F test/join5.test 86675fc2919269aa923c84dd00ee4249b97990fe
F test/join6.test bf82cf3f979e9eade83ad0d056a66c5ed71d1901
F test/journal1.test 36f2d1bb9bf03f790f43fbdb439e44c0657fab19
F test/jrnlmode.test 76f94d61528c5ff32102a12f8cf34f4cc36f7849
F test/jrnlmode.test cd0c9c5b2555f3d5bb72ed8aa8d0ad16ecf77e7c
F test/jrnlmode2.test fe79ea1f0375c926b8de0362ddf94f34a64135fd
F test/jrnlmode3.test cfcdb12b90e640a23b92785a002d96c0624c8710
F test/keyword1.test a2400977a2e4fde43bf33754c2929fda34dbca05
@ -823,7 +823,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
P f80c3f922a114e738613955a939db46cf0847038
R f2ba6ac15d8c700b7fd50a974fe0be0f
P cccd32c692057beb08a994102c6a10126ddeb937
R cc967c249a884e7c285bdbc1b3f00097
U dan
Z bff60ae022798c7d58eb4dc568bf20d9
Z 4ebb4fa39dfc135851bcdd3d6648050e

View File

@ -1 +1 @@
cccd32c692057beb08a994102c6a10126ddeb937
1ec74591a93e8b27ad3ac739914a48a91972e82c

View File

@ -5877,20 +5877,6 @@ int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){
/* Change the journal mode. */
pPager->journalMode = (u8)eMode;
/* When transistioning from TRUNCATE or PERSIST to any other journal
** mode (and we are not in locking_mode=EXCLUSIVE) then delete the
** journal file.
*/
assert( (PAGER_JOURNALMODE_TRUNCATE & 5)==1 );
assert( (PAGER_JOURNALMODE_PERSIST & 5)==1 );
assert( (PAGER_JOURNALMODE_DELETE & 5)!=1 );
assert( (PAGER_JOURNALMODE_MEMORY & 5)!=1 );
assert( (PAGER_JOURNALMODE_OFF & 5)!=1 );
assert( (PAGER_JOURNALMODE_WAL & 5)!=1 );
if( (eOld & 5)==1 && (eMode & 5)!=1 && !pPager->exclusiveMode ){
sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
}
}
/* Return the new journal mode */

View File

@ -484,7 +484,7 @@ ifcapable pragma {
INSERT INTO t4 VALUES(3, 4);
}
file exists test.db-journal
} {0}
} {1}
do_test jrnlmode-6.7 {
execsql {
COMMIT;
@ -493,7 +493,7 @@ ifcapable pragma {
} {1 2 3 4}
do_test jrnlmode-6.8 {
file exists test.db-journal
} {0}
} {1}
do_test jrnlmode-6.9 {
execsql {
PRAGMA journal_mode = DELETE;