From: dan Date: Mon, 28 Jun 2010 11:23:09 +0000 (+0000) Subject: Fix some errors when compiling with SQLITE_OMIT_WAL. X-Git-Tag: version-3.7.2~217 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38e1a279c992a4493bcc71ddaa58e772c993ff29;p=thirdparty%2Fsqlite.git Fix some errors when compiling with SQLITE_OMIT_WAL. FossilOrigin-Name: 3b68cb9c656db8c5c481199919a98f5764f7ebfa --- diff --git a/manifest b/manifest index 951b57fe22..3d9f947270 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sdebugging\scode\sfrom\stest\sscript. -D 2010-06-28T11:06:54 +C Fix\ssome\serrors\swhen\scompiling\swith\sSQLITE_OMIT_WAL. +D 2010-06-28T11:23:10 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 ec7c7f7ca224ce2ff58736eebf804b48a75f9946 F src/os_win.c 48f67798969ba983487fed5691059ade7fff2ef7 -F src/pager.c 05bd0bd2a665c8e4d4754ac3e476f1e05ee1961c +F src/pager.c 57713740025de859972c81104c27d57ed9c551c6 F src/pager.h 879fdde5a102d2f21a3135d6f647530b21c2796c F src/parse.y ace5c7a125d9f2a410e431ee3209034105045f7e F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07 @@ -177,7 +177,7 @@ F src/sqliteLimit.h 196e2f83c3b444c4548fc1874f52f84fdbda40f3 F src/status.c 4df6fe7dce2d256130b905847c6c60055882bdbe F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e F src/tclsqlite.c b898ab058f51ee57e6b54aa8de902526a5376959 -F src/test1.c e3e0ad1f0763a1aa6adf7e1c50727718eaa4bd32 +F src/test1.c 812467c6cb8af8604e912314b7cd68598a024e79 F src/test2.c e3f564ab1e9fd0b47b0c9e23e7054e38bf0836cf F src/test3.c 4c21700c73a890a47fc685c1097bfb661346ac94 F src/test4.c ad03bb987ddedce928f4258c1e7fa4109a73497d @@ -227,7 +227,7 @@ F src/vdbemem.c 5e579abf6532001dfbee0e640dc34eae897a9807 F src/vdbetrace.c 864cef96919323482ebd9986f2132435115e9cc2 F src/vtab.c a0f8a40274e4261696ef57aa806de2776ab72cda F src/wal.c 7666c113e99fb510ecd3043490798cec5a771e73 -F src/wal.h 4ace25262452d17e7d3ec970c89ee17794004008 +F src/wal.h 906c85760598b18584921fe08008435aa4eeeeb2 F src/walker.c 3112bb3afe1d85dc52317cb1d752055e9a781f8f F src/where.c 1c895bef33d0dfc7ed90fb1f74120435d210ea56 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -534,7 +534,7 @@ F test/notify2.test 195a467e021f74197be2c4fb02d6dee644b8d8db F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347 F test/null.test a8b09b8ed87852742343b33441a9240022108993 F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec -F test/pager1.test 18d3546658573ed7fffd32f482f7447f814f16d7 +F test/pager1.test d8dfe2f8a641f5f7960f7a071f0c84f7ba23cc01 F test/pager2.test f5c757c271ce642d36a393ecbfb3aef1c240dcef F test/pagerfault.test a6b0ef0f9e678aea5a649c78efee284516abaf83 F test/pagerfault2.test 1287f123bd5d20452113739ed7755fd254e502f1 @@ -828,7 +828,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 4932f22848b3d15a2b6dc5fa2cd69ce19182e2a4 -R 4a625949f25b07f36138336c0af273e0 +P a85ae33246226801f88c1e377725c192711797cc +R c039a24618e8fbf1e98f4efbf1b986ad U dan -Z 4030868382f7f112c3c45080ad69e4cc +Z 0199b159e4b296798119a8a04c398a43 diff --git a/manifest.uuid b/manifest.uuid index c847e9b00d..67ea4eeed3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a85ae33246226801f88c1e377725c192711797cc \ No newline at end of file +3b68cb9c656db8c5c481199919a98f5764f7ebfa \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index 1d816b0848..9bef3ae7a3 100644 --- a/src/pager.c +++ b/src/pager.c @@ -221,7 +221,9 @@ struct PagerSavepoint { Bitvec *pInSavepoint; /* Set of pages in this savepoint */ Pgno nOrig; /* Original number of pages in file */ Pgno iSubRec; /* Index of first record in sub-journal */ +#ifndef SQLITE_OMIT_WAL u32 aWalData[WAL_SAVEPOINT_NDATA]; /* WAL savepoint context */ +#endif }; /* diff --git a/src/test1.c b/src/test1.c index e636bb1b89..64a6b8fb0f 100644 --- a/src/test1.c +++ b/src/test1.c @@ -5213,9 +5213,11 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ (char*)&sqlite3WhereTrace, TCL_LINK_INT); Tcl_LinkVar(interp, "sqlite_os_trace", (char*)&sqlite3OSTrace, TCL_LINK_INT); +#ifndef SQLITE_OMIT_WAL Tcl_LinkVar(interp, "sqlite_wal_trace", (char*)&sqlite3WalTrace, TCL_LINK_INT); #endif +#endif #ifndef SQLITE_OMIT_DISKIO Tcl_LinkVar(interp, "sqlite_opentemp_count", (char*)&sqlite3_opentemp_count, TCL_LINK_INT); diff --git a/src/wal.h b/src/wal.h index 34710a4082..f29d5838f5 100644 --- a/src/wal.h +++ b/src/wal.h @@ -27,13 +27,14 @@ # define sqlite3WalRead(v,w,x,y,z) 0 # define sqlite3WalDbsize(y,z) # define sqlite3WalBeginWriteTransaction(y) 0 -# define sqlite3WalEndWRiteTransaction(x) 0 +# define sqlite3WalEndWriteTransaction(x) 0 # define sqlite3WalUndo(x,y,z) 0 # define sqlite3WalSavepoint(y,z) # define sqlite3WalSavepointUndo(y,z) 0 # define sqlite3WalFrames(u,v,w,x,y,z) 0 # define sqlite3WalCheckpoint(u,v,w,x) 0 # define sqlite3WalCallback(z) 0 +# define sqlite3WalExclusiveMode(y,z) 0 #else #define WAL_SAVEPOINT_NDATA 4 diff --git a/test/pager1.test b/test/pager1.test index b5879d9708..aa48cd5d3a 100644 --- a/test/pager1.test +++ b/test/pager1.test @@ -957,45 +957,47 @@ do_test pager1-6.2 { # $ws: The expected size of the WAL file, in bytes, after executing # the SQL script. Or -1 if the WAL is not expected to exist. # -faultsim_delete_and_reopen -foreach {tn sql res js ws} [subst { - - 1 { - CREATE TABLE t1(a, b); - PRAGMA auto_vacuum=OFF; - PRAGMA synchronous=NORMAL; - PRAGMA page_size=1024; - PRAGMA locking_mode=EXCLUSIVE; - PRAGMA journal_mode=TRUNCATE; - INSERT INTO t1 VALUES(1, 2); - } {exclusive truncate} 0 -1 - - 2 { - BEGIN IMMEDIATE; - SELECT * FROM t1; - COMMIT; - } {1 2} 0 -1 - - 3 { - BEGIN; - SELECT * FROM t1; - COMMIT; - } {1 2} 0 -1 - - 4 { PRAGMA journal_mode = WAL } wal -1 -1 - 5 { INSERT INTO t1 VALUES(3, 4) } {} -1 [wal_file_size 1 1024] - 6 { PRAGMA locking_mode = NORMAL } normal -1 [wal_file_size 1 1024] - 7 { INSERT INTO t1 VALUES(5, 6); } {} -1 [wal_file_size 2 1024] - - 8 { PRAGMA journal_mode = TRUNCATE } truncate 0 -1 - 9 { INSERT INTO t1 VALUES(7, 8) } {} 0 -1 - 10 { SELECT * FROM t1 } {1 2 3 4 5 6 7 8} 0 -1 - -}] { - do_execsql_test pager1-7.1.$tn.1 $sql $res - catch { set J -1 ; set J [file size test.db-journal] } - catch { set W -1 ; set W [file size test.db-wal] } - do_test pager1-7.1.$tn.2 { list $J $W } [list $js $ws] +ifcapable wal { + faultsim_delete_and_reopen + foreach {tn sql res js ws} [subst { + + 1 { + CREATE TABLE t1(a, b); + PRAGMA auto_vacuum=OFF; + PRAGMA synchronous=NORMAL; + PRAGMA page_size=1024; + PRAGMA locking_mode=EXCLUSIVE; + PRAGMA journal_mode=TRUNCATE; + INSERT INTO t1 VALUES(1, 2); + } {exclusive truncate} 0 -1 + + 2 { + BEGIN IMMEDIATE; + SELECT * FROM t1; + COMMIT; + } {1 2} 0 -1 + + 3 { + BEGIN; + SELECT * FROM t1; + COMMIT; + } {1 2} 0 -1 + + 4 { PRAGMA journal_mode = WAL } wal -1 -1 + 5 { INSERT INTO t1 VALUES(3, 4) } {} -1 [wal_file_size 1 1024] + 6 { PRAGMA locking_mode = NORMAL } normal -1 [wal_file_size 1 1024] + 7 { INSERT INTO t1 VALUES(5, 6); } {} -1 [wal_file_size 2 1024] + + 8 { PRAGMA journal_mode = TRUNCATE } truncate 0 -1 + 9 { INSERT INTO t1 VALUES(7, 8) } {} 0 -1 + 10 { SELECT * FROM t1 } {1 2 3 4 5 6 7 8} 0 -1 + + }] { + do_execsql_test pager1-7.1.$tn.1 $sql $res + catch { set J -1 ; set J [file size test.db-journal] } + catch { set W -1 ; set W [file size test.db-wal] } + do_test pager1-7.1.$tn.2 { list $J $W } [list $js $ws] + } } foreach {tn filename} {