- C Merge\sthe\s3.9.1\supdates\sfrom\strunk.
- D 2015-10-16T20:55:12.158
- F Makefile.in 2ea961bc09e441874eb3d1bf7398e04feb24f3ee
-C Increase\sthe\sversion\snumber\sto\s3.10.0,\sdue\sto\sthe\saddition\sof\sthe\nsqlite3_db_cacheflush()\sinterface.
-D 2015-10-30T16:36:42.626
++C Merge\sthe\ssqlite3_db_cacheflush()\senhancements\sand\sother\schanges\sfrom\strunk.
++D 2015-10-30T17:17:12.895
+ F Makefile.in 4469ed8b02a9934fea9503d791165367d19db2f7
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
- F Makefile.msc 4eb750e0fdf52050a06d881e1b060f4bb116ed7e
+ F Makefile.msc 702d3e98f3afc6587a78481257f3c4c900efc3a4
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
- F VERSION a47917b59f38b632b3a8662d14fd20f94956bdd0
+ F VERSION 8b9d3ac6f1962f94e06ba05462422a544f9c4e36
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
F src/backup.c c3a9c4209439b806c44cf30daf466955727bf46c
F src/bitvec.c d1f21d7d91690747881f03940584f4cc548c9d3d
F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79
- F src/btree.c 8853e6dab83f485d3f61a61f9d9a1975ab20b6af
- F src/btree.h cd4946a0a00f84e974a10ffd09d53cfbfab758f6
-F src/btree.c 77343aac89c50bb5e06cbca3ace8c057c14de57c
-F src/btree.h b512723e4f27d7ba16b4b985cdecdb82c0f6d0c0
-F src/btreeInt.h 8177c9ab90d772d6d2c6c517e05bed774b7c92c0
-F src/build.c d6162335d690396dfc5c4bd59e8b2b0c14ba6285
++F src/btree.c 0a1dd8e05e69a47b73e09b2e70d2d5f0617205c3
++F src/btree.h 86b2232cafcbae3aa867b2c87f165e942927f48d
+F src/btreeInt.h df0e92901c6fbb01aa8fab3cfbcdaaba2654fd04
+F src/build.c 569313d3777bfcb2dfc89f243d76efd158959325
F src/callback.c 7b44ce59674338ad48b0e84e7b72f935ea4f68b0
F src/complete.c addcd8160b081131005d5bc2d34adf20c1c5c92f
F src/ctime.c 509ef9c64d1321f42448f111da86400b1799218a
F src/os_unix.c fc93d55f96bb978f0b0168c6ea7d6fc60b0e172c
F src/os_win.c 1716291e5ec2dbfc5a1fe0b32182030f1f7d8acf
F src/os_win.h eb7a47aa17b26b77eb97e4823f20a00b8bda12ca
- F src/pager.c 13780cd829f48fbb4cbedc76b4d9185315861ea3
- F src/pager.h 4d9e5ec29e44f32cf5e8bdad464e67a1c5a53d29
- F src/parse.y 0dcce0ae4e106cdaad4053f73b3bc2dedca9c6d6
-F src/pager.c 9c1eec0d88133484b165fa0b5284a411c24b964c
-F src/pager.h 1c4fa826c330040c5659a384446c7cc6e8e4200c
-F src/parse.y 11078cd8e3af00f030505b6a86a06a4536cfdeaa
++F src/pager.c e69349b91ad7414f32484352057898e820020085
++F src/pager.h 6f280ca64b57cb2faace7e9045ce2b09493eaa06
++F src/parse.y 764d5b40e8ac0ce356b6ba096df5cc246b3829e1
F src/pcache.c 24be750c79272e0ca7b6e007bc94999700f3e5ef
F src/pcache.h 9968603796240cdf83da7e7bef76edf90619cea9
F src/pcache1.c 902e1bc7bdaa81b40f8543407c5e2ac8ef4dc035
F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
F src/resolve.c 1954a0f01bf65d78d7d559aea3d5c67f33376d91
F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
- F src/select.c dbf1fb82317043304da334a33206add211487f96
+ F src/select.c 167b4e9058bc8e997d18d6b6b20ecbb0c9c457af
F src/shell.c d25df04168d6ba5a4fa05bdbf859df667f9eb621
- F src/sqlite.h.in 839c818e16ea68703d90d17bd2bb3607191debce
+ F src/sqlite.h.in 3cfc86c55e57c63d86b9e1e92869e2bfb162ca8e
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
F src/sqlite3ext.h 4b66e3e3435da4b4c8c83696d0349f0c503b3924
- F src/sqliteInt.h b015def467069111aa556837331ee24a00765701
-F src/sqliteInt.h b1e72ffe282c91ae30a2bf403319126dbaebd556
++F src/sqliteInt.h 00b72ce91549aa675876f1757f54f432fd999e6e
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
- F src/status.c 286f6398a4d2cd1e8ff0771e3d30f8dddb4768ea
+ F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
F src/tclsqlite.c d9439b6a910985b7fff43ba6756bcef00de22649
- F src/test1.c 8fff9c5aa63d6490f516d018b70c12a9cb9a4d8a
+ F src/test1.c 9ac5cbfe3c859ab7518edc5109a2959d6bf7b059
F src/test2.c 577961fe48961b2f2e5c8b56ee50c3f459d3359d
- F src/test3.c 64d2afdd68feac1bb5e2ffb8226c8c639f798622
+ F src/test3.c f7ae1d6a4aa07aac257de18a43800c1199b513fc
F src/test4.c d168f83cc78d02e8d35567bb5630e40dcd85ac1e
F src/test5.c 5a34feec76d9b3a86aab30fd4f6cc9c48cbab4c1
F src/test6.c 41cacf3b0dd180823919bf9e1fbab287c9266723
F src/test_backup.c 2e6e6a081870150f20c526a2e9d0d29cda47d803
F src/test_blob.c e5a7a81d61a780da79101aeb1e60d300af169e07
F src/test_btree.c 2e9978eca99a9a4bfa8cae949efb00886860a64f
- F src/test_config.c fe04d07d9b097a26f008fbe29b0bcd72e239c555
-F src/test_config.c 426527fbb12fc23669a1e973ecdc8c5e92c2e2cf
++F src/test_config.c cbdf8757e36d0d29f48c636f02ea45fa905792b2
F src/test_demovfs.c 0de72c2c89551629f58486fde5734b7d90758852
F src/test_devsym.c e7498904e72ba7491d142d5c83b476c4e76993bc
F src/test_fs.c ced436e3d4b8e4681328409b8081051ce614e28f
F src/tokenize.c 338bc8f7c9dd103188952cda7964696bacac6d22
F src/treeview.c 154f0acc622fa3514de8777dcedf4c8a8802b4ce
F src/trigger.c 322f23aad694e8f31d384dcfa386d52a48d3c52f
- F src/update.c aa10336a2719bd1b9f89004f3d7ba6d566623a49
+ F src/update.c 40e51cd0883cb5bfd6abb7d8a7cd8aa47fab2945
F src/utf.c fc6b889ba0779b7722634cdeaa25f1930d93820c
F src/util.c fc612367108b74573c5fd13a85d0a23027f438bd
-F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
-F src/vdbe.c dfbaae2570172c523bce14299021d352b8508f7f
+F src/vacuum.c 983cc3754718ef169a6ea9aef86798bd28106f21
- F src/vdbe.c 80c332d7c16ac768e31610586103e59985ce65d4
- F src/vdbe.h 4bc88bd0e06f8046ee6ab7487c0015e85ad949ad
- F src/vdbeInt.h 777dd76d513347acb1a71d94df2be00516add637
++F src/vdbe.c 4ab876409aaf77781a88ce8ae6da433eb0d86b3b
+ F src/vdbe.h efb7a8c1459e31f3ea4377824c6a7e4cb5068637
+ F src/vdbeInt.h 33403622c6a8feaaac5f0f3f17f5d1bf6df42286
F src/vdbeapi.c 020681b943e77766b32ae1cddf86d7831b7374ca
- F src/vdbeaux.c 14e4b4d69882eb160bf20f31ded674f1b0455b5e
-F src/vdbeaux.c 717bc2ae9cc0b58ef398fff44bd9164bfd96772a
++F src/vdbeaux.c 2a20e7f59c04824d16c002d51cf3ff62efe96474
F src/vdbeblob.c 565fabd302f5fca3bdf3d56cac330483616a39b6
F src/vdbemem.c fdd1578e47bea61390d472de53c565781d81e045
F src/vdbesort.c 8b23930a1289526f6d2a3a9f2e965bcc963e4a68
F src/vdbetrace.c 8befe829faff6d9e6f6e4dee5a7d3f85cc85f1a0
F src/vtab.c 2a8b44aa372c33f6154208e7a7f6c44254549806
F src/vxworks.h c18586c8edc1bddbc15c004fa16aeb1e1342b4fb
-F src/wal.c 18b0ed49830cf04fe2d68224b41838a73ac6cd24
-F src/wal.h df01efe09c5cb8c8e391ff1715cca294f89668a4
+F src/wal.c fd2351d771df2e147b0d6a952314078fa20af171
+F src/wal.h 361b16891d2772294b138054c84f5a3bad6e9d05
F src/walker.c 2e14d17f592d176b6dc879c33fbdec4fbccaa2ba
- F src/where.c 4c4646675e794ac71e701289edefd7cd81bac844
+ F src/where.c 6aceb72cc58dc06922a9e1604d559c8ca4c3e728
F src/whereInt.h 7892bb54cf9ca0ae5c7e6094491b94c9286dc647
- F src/wherecode.c b924b78acd9e623fb69bfa2cb65cd7d542166dd3
+ F src/wherecode.c 4c96182e7b25e4be54008dee2da5b9c2f8480b9b
F src/whereexpr.c e63244ca06c503e5f3c5b7f3c9aea0db826089ed
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
F test/affinity2.test a6d901b436328bd67a79b41bb0ac2663918fe3bd
F test/zerodamage.test cf6748bad89553cc1632be51a6f54e487e4039ac
F tool/GetFile.cs a15e08acb5dd7539b75ba23501581d7c2b462cb5
F tool/GetTclKit.bat 8606413d3035c05373a0d7fae82ebf59ae9e16c3
- F tool/addopcodes.tcl 2b5886e104b8d9ccee8ead9b873c99d2144644c9
- F tool/build-all-msvc.bat 2b1703b322da121e56b955cb58de091107f777c3 x
-F tool/addopcodes.tcl 26892c394964c194fe96b9a79b8b9f87347c7151
++F tool/addopcodes.tcl c732baeac0528e5d7d9306c3a74c914997fe93eb
+ F tool/build-all-msvc.bat e42141ca3c3812315432f9813ef9eb78aa8d99c9 x
F tool/build-shell.sh 950f47c6174f1eea171319438b93ba67ff5bf367
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
F tool/extract.c 054069d81b095fbdc189a6f5d4466e40380505e2
F tool/lempar.c 3617143ddb9b176c3605defe6a9c798793280120
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
- F tool/mkautoconfamal.sh d1a2da0e15b2ed33d60af35c7e9d483f13a8eb9f
+ F tool/mkautoconfamal.sh 4bdf61548a143e5977bd86ab93d68b694d10c8fa
-F tool/mkkeywordhash.c dfff09dbbfaf950e89af294f48f902181b144670
+F tool/mkkeywordhash.c ff6fc41e733204e289b38b9cd3808701725c6793
F tool/mkopcodec.tcl edde8adc42621b5e598127f8cdc6d52cfe21f52b
F tool/mkopcodeh.tcl e04177031532b7aa9379ded50e820231ac4abd6e
F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
- P 5c3a2a6ed64f4d0e10238720bc2e4ae3af3eded3 39e8a5d93fa370afb03223bf0c20ea0f3448b9fc
- R 7284c946ddd25bd093ddb09b393f0312
-P ad80d3073388c59f67171720efc6ef766e19886f
-R 05540c814207efb67f7c8e8b3a47d3f0
++P bf866e6c0d95d48744c86ff0c0be9b2653629a18 7565b046ff939e8310631397a4526fbd98b99aaf
++R bb025d4354b8efe42b8f9f24be63437f
U drh
- Z 35321be2437db247384d1ee5f9fe5138
-Z 14542ee53e71e033be97bac3859f7dcc
++Z 8831d8115b67000b0013e73a4bc13ce5
}
/*
-** This function may only be called while a write-transaction is active in
-** rollback. If the connection is in WAL mode, this call is a no-op.
-** Otherwise, if the connection does not already have an EXCLUSIVE lock on
-** the database file, an attempt is made to obtain one.
-**
-** If the EXCLUSIVE lock is already held or the attempt to obtain it is
-** successful, or the connection is in WAL mode, SQLITE_OK is returned.
-** Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
-** returned.
+** This function is called to ensure that all locks required to commit the
+** current write-transaction to the database file are held. If the db is
+** in rollback mode, this means the EXCLUSIVE lock on the database file.
+**
+** Or, if this is a non-CONCURRENT transaction on a wal-mode database, this
+** function is a no-op.
+**
+** If this is an CONCURRENT transaction on a wal-mode database, this function
+** attempts to obtain the WRITER lock on the wal file and also checks to
+** see that the transaction can be safely committed (does not commit with
+** any other transaction committed since it was opened).
+**
+** If the required locks are already held or successfully obtained and
+** the transaction can be committed, SQLITE_OK is returned. If a required lock
+** cannot be obtained, SQLITE_BUSY is returned. Or, if the current transaction
+** is CONCURRENT and cannot be committed due to a conflict, SQLITE_BUSY_SNAPSHOT
+** is returned. Otherwise, if some other error occurs (IO error, OOM etc.),
+** and SQLite error code is returned.
*/
-int sqlite3PagerExclusiveLock(Pager *pPager){
+int sqlite3PagerExclusiveLock(Pager *pPager, PgHdr *pPage1){
- int rc = SQLITE_OK;
- assert( pPager->eState==PAGER_WRITER_CACHEMOD
- || pPager->eState==PAGER_WRITER_DBMOD
- || pPager->eState==PAGER_WRITER_LOCKED
- );
+ int rc = pPager->errCode;
assert( assert_pager_state(pPager) );
- if( 0==pagerUseWal(pPager) ){
- rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
- }
+ if( rc==SQLITE_OK ){
+ assert( pPager->eState==PAGER_WRITER_CACHEMOD
+ || pPager->eState==PAGER_WRITER_DBMOD
+ || pPager->eState==PAGER_WRITER_LOCKED
+ );
+ assert( assert_pager_state(pPager) );
+ if( 0==pagerUseWal(pPager) ){
+ rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
+ }
+#ifndef SQLITE_OMIT_CONCURRENT
- else{
- if( pPager->pAllRead ){
- /* This is an CONCURRENT transaction. Attempt to lock the wal database
- ** here. If SQLITE_BUSY (but not SQLITE_BUSY_SNAPSHOT) is returned,
- ** invoke the busy-handler and try again for as long as it returns
- ** non-zero. */
- do {
- rc = sqlite3WalLockForCommit(pPager->pWal, pPage1, pPager->pAllRead);
- }while( rc==SQLITE_BUSY
- && pPager->xBusyHandler(pPager->pBusyHandlerArg)
- );
++ else{
++ if( pPager->pAllRead ){
++ /* This is an CONCURRENT transaction. Attempt to lock the wal database
++ ** here. If SQLITE_BUSY (but not SQLITE_BUSY_SNAPSHOT) is returned,
++ ** invoke the busy-handler and try again for as long as it returns
++ ** non-zero. */
++ do {
++ rc = sqlite3WalLockForCommit(pPager->pWal, pPage1, pPager->pAllRead);
++ }while( rc==SQLITE_BUSY
++ && pPager->xBusyHandler(pPager->pBusyHandlerArg)
++ );
++ }
+ }
- }
+#endif /* SQLITE_OMIT_CONCURRENT */
++ }
+ return rc;
+}
+
+#ifndef SQLITE_OMIT_CONCURRENT
+/*
+** This function is called as part of committing an CONCURRENT transaction.
+** At this point the wal WRITER lock is held, and all pages in the cache
+** except for page 1 are compatible with the snapshot at the head of the
+** wal file.
+**
+** This function updates the in-memory data structures and reloads the
+** contents of page 1 so that the client is operating on the snapshot
+** at the head of the wal file.
+**
+** SQLITE_OK is returned if successful, or an SQLite error code otherwise.
+*/
+int sqlite3PagerUpgradeSnapshot(Pager *pPager, DbPage *pPage1){
+ int rc;
+ u32 iFrame = 0;
+
+ assert( pPager->pWal && pPager->pAllRead );
+ rc = sqlite3WalUpgradeSnapshot(pPager->pWal);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3WalFindFrame(pPager->pWal, 1, &iFrame);
}
+ if( rc==SQLITE_OK ){
+ rc = readDbPage(pPage1, iFrame);
+ }
+
return rc;
}