aboutsummaryrefslogtreecommitdiff
path: root/src/pragma.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-05-06 21:37:22 +0000
committerdrh <drh@noemail.net>2010-05-06 21:37:22 +0000
commit3ebaee9633db3e3d97cde82922bb50d95e731618 (patch)
treedc99485ca330d31387f767b08e7f4fd276588b77 /src/pragma.c
parent72af0774f9a2d75e8e2dccb0fb15626babf8a875 (diff)
downloadsqlite-3ebaee9633db3e3d97cde82922bb50d95e731618.tar.gz
sqlite-3ebaee9633db3e3d97cde82922bb50d95e731618.zip
The PRAGMA journal_mode=WAL; command now makes WAL the default journal mode
for new databases added with ATTACH, so the behavior is consistent with the other journal modes. FossilOrigin-Name: c3520460a4a39fc5e981c3033068ffbb422a4af2
Diffstat (limited to 'src/pragma.c')
-rw-r--r--src/pragma.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pragma.c b/src/pragma.c
index c3aaaf9b3..d98b68055 100644
--- a/src/pragma.c
+++ b/src/pragma.c
@@ -531,7 +531,8 @@ void sqlite3Pragma(
/*
** PRAGMA [database.]journal_mode
- ** PRAGMA [database.]journal_mode = (delete|persist|off|truncate|memory)
+ ** PRAGMA [database.]journal_mode =
+ ** (delete|persist|off|truncate|memory|wal|off)
*/
if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){
int eMode; /* One of the PAGER_JOURNALMODE_XXX symbols */
@@ -562,15 +563,14 @@ void sqlite3Pragma(
}else{
int ii;
- if( pId2->n==0 && eMode!=PAGER_JOURNALMODE_WAL ){
- /* This indicates that no database name was specified as part
- ** of the PRAGMA command. In this case the journal-mode must be
- ** set on all attached databases, as well as the main db file.
+ if( pId2->n==0 ){
+ /* When there is no database name before the "journal_mode" keyword
+ ** in the PRAGMA, then the journal-mode will be set on
+ ** all attached databases, as well as the main db file.
**
** Also, the sqlite3.dfltJournalMode variable is set so that
** any subsequently attached databases also use the specified
- ** journal mode. Except, the default journal mode is never set
- ** to WAL.
+ ** journal mode.
*/
db->dfltJournalMode = (u8)eMode;
}