]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Simplify the sqlite3_wal_checkpoint() documentation. Add some source code
authordrh <drh@noemail.net>
Wed, 3 Dec 2014 18:32:47 +0000 (18:32 +0000)
committerdrh <drh@noemail.net>
Wed, 3 Dec 2014 18:32:47 +0000 (18:32 +0000)
evidence marks.

FossilOrigin-Name: 026c44ff2c092b14faa19985dd46873aeb8727dc

manifest
manifest.uuid
src/main.c
src/sqlite.h.in

index e54424a2c5eb7df8696c8923f6da97e9901a8c30..350040c92616265e8122667f9f6cc52cf7107f17 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Futher\stweaks\sto\sthe\ssqlite3_wal_checkpoint_v2()\sdocumentation.
-D 2014-12-03T16:30:27.252
+C Simplify\sthe\ssqlite3_wal_checkpoint()\sdocumentation.\s\sAdd\ssome\ssource\scode\nevidence\smarks.
+D 2014-12-03T18:32:47.200
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in a226317fdf3f4c895fb3cfedc355b4d0868ce1fb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -195,7 +195,7 @@ F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
 F src/legacy.c ba1863ea58c4c840335a84ec276fc2b25e22bc4e
 F src/lempar.c 7274c97d24bb46631e504332ccd3bd1b37841770
 F src/loadext.c de741e66e5ddc1598d904d7289239696e40ed994
-F src/main.c 34b895b5ebfc73cd690dcd9ac6d0eecb28ce729f
+F src/main.c 84cc0fc4861bd2b06c286b38bf03bce604a0a66a
 F src/malloc.c 740db54387204c9a2eb67c6d98e68b08e9ef4eab
 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
 F src/mem1.c faf615aafd8be74a71494dfa027c113ea5c6615f
@@ -230,7 +230,7 @@ F src/resolve.c 4965007d6497b6a4d7a6d98751cc39712885f952
 F src/rowset.c eccf6af6d620aaa4579bd3b72c1b6395d9e9fa1e
 F src/select.c 428165951748151e87a15295b7357221433e311b
 F src/shell.c 45d9c9bd7cde07845af957f2d849933b990773cf
-F src/sqlite.h.in 8c881e8d225167a878ed7d78a776b372304823a9
+F src/sqlite.h.in dd3721b533e9608677203917aa18bb477aede13d
 F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
 F src/sqlite3ext.h 17d487c3c91b0b8c584a32fbeb393f6f795eea7d
 F src/sqliteInt.h c9e95b8fa9aee30d46387735c5be73fa58886e38
@@ -1223,7 +1223,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 1e212d9899387344fd62c7b6fbcc59ea885b6d7c
-R e9765e182534ca03b14c9167cc7abee7
+P 7d284d047b0677fb4532df5aae06f5bad997f5e9
+R 0867d5ea698016229ebc4122ede6b104
 U drh
-Z 0ecdc98d536d1a5e17e6fc5f0fd27d98
+Z a6f1638a8e5b63a53571b9743845c380
index b7540920016545f36fa90b55e7bb686cdbb66da5..0243d4de584f9fe550756e0a95707b17d20a9afd 100644 (file)
@@ -1 +1 @@
-7d284d047b0677fb4532df5aae06f5bad997f5e9
\ No newline at end of file
+026c44ff2c092b14faa19985dd46873aeb8727dc
\ No newline at end of file
index 9ac3fde733ec059211d2f2c549beba07c3a0b48c..f7a0b1f7fda35d033db590079032ff960a6df623 100644 (file)
@@ -1941,6 +1941,8 @@ int sqlite3_wal_checkpoint_v2(
   assert( SQLITE_CHECKPOINT_RESTART==2 );
   assert( SQLITE_CHECKPOINT_TRUNCATE==3 );
   if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_TRUNCATE ){
+    /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint
+    ** mode: */
     return SQLITE_MISUSE;
   }
 
@@ -1968,7 +1970,9 @@ int sqlite3_wal_checkpoint_v2(
 ** checkpointed.
 */
 int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
-  return sqlite3_wal_checkpoint_v2(db, zDb, SQLITE_CHECKPOINT_PASSIVE, 0, 0);
+  /* EVIDENCE-OF: R-41613-20553 The sqlite3_wal_checkpoint(D,X) is equivalent to
+  ** sqlite3_wal_checkpoint_v2(D,X,SQLITE_CHECKPOINT_PASSIVE,0,0). */
+  return sqlite3_wal_checkpoint_v2(db,zDb,SQLITE_CHECKPOINT_PASSIVE,0,0);
 }
 
 #ifndef SQLITE_OMIT_WAL
index 09ba5038dd03c5e65d5d3371a5cbb2b48629beca..6c44ffefd64cd60d8164743f209e90b5cf7943ef 100644 (file)
@@ -7241,22 +7241,21 @@ int sqlite3_wal_autocheckpoint(sqlite3 *db, int N);
 /*
 ** CAPI3REF: Checkpoint a database
 **
-** ^The [sqlite3_wal_checkpoint(D,X)] interface causes database named X
-** on [database connection] D to be [checkpointed].  ^If X is NULL or an
-** empty string, then a checkpoint is run on all databases of
-** connection D.  ^If the database connection D is not in
-** [WAL | write-ahead log mode] then this interface is a harmless no-op.
-** ^The [sqlite3_wal_checkpoint(D,X)] interface initiates a
-** [sqlite3_wal_checkpoint_v2|PASSIVE] checkpoint.
-** Use the [sqlite3_wal_checkpoint_v2()] interface to get a FULL
-** or RESET or TRUNCATE checkpoint.
-**
-** ^The [wal_checkpoint pragma] can be used to invoke this interface
-** from SQL.  ^The [sqlite3_wal_autocheckpoint()] interface and the
-** [wal_autocheckpoint pragma] can be used to cause this interface to be
-** run whenever the WAL reaches a certain size threshold.
-**
-** See also: [sqlite3_wal_checkpoint_v2()]
+** ^(The sqlite3_wal_checkpoint(D,X) is equivalent to
+** [sqlite3_wal_checkpoint_v2](D,X,[SQLITE_CHECKPOINT_PASSIVE],0,0).)^
+**
+** In brief, sqlite3_wal_checkpoint(D,X) causes the content in the 
+** [write-ahead log] for database X on [database connection] D to be
+** transferred into the database file and for the write-ahead log to
+** be reset.  See the [checkpointing] documentation for addition
+** information.
+**
+** This interface used to be the only way to cause a checkpoint to
+** occur.  But then the newer and more powerful [sqlite3_wal_checkpoint_v2()]
+** interface was added.  This interface is retained for backwards
+** compatibility and as a convenience for applications that need to manually
+** start a callback but which do not need the full power (and corresponding
+** complication) of [sqlite3_wal_checkpoint_v2()].
 */
 int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
 
@@ -7272,8 +7271,7 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb);
 ** <dt>SQLITE_CHECKPOINT_PASSIVE<dd>
 **   ^Checkpoint as many frames as possible without waiting for any database 
 **   readers or writers to finish, then sync the database file if all frames 
-**   in the log were checkpointed. ^This mode is the same as calling 
-**   [sqlite3_wal_checkpoint()]. ^The [sqlite3_busy_handler|busy-handler callback]
+**   in the log were checkpointed. ^The [sqlite3_busy_handler|busy-handler callback]
 **   is never invoked in the SQLITE_CHECKPOINT_PASSIVE mode.  ^On the other hand,
 **   passive mode might leave the checkpoint unfinished if there are concurrent
 **   readers or writers.