@@ -133,7 +133,7 @@ extern "C" {
133
133
**
134
134
** Since [version 3.6.18] ([dateof:3.6.18]),
135
135
** SQLite source code has been stored in the
136
- ** <a href="http://www. fossil-scm.org/">Fossil configuration management
136
+ ** <a href="http://fossil-scm.org/">Fossil configuration management
137
137
** system</a>. ^The SQLITE_SOURCE_ID macro evaluates to
138
138
** a string which identifies a particular check-in of SQLite
139
139
** within its configuration management system. ^The SQLITE_SOURCE_ID
@@ -146,9 +146,9 @@ extern "C" {
146
146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147
147
** [sqlite_version()] and [sqlite_source_id()].
148
148
*/
149
- #define SQLITE_VERSION "3.49.1 "
150
- #define SQLITE_VERSION_NUMBER 3049001
151
- #define SQLITE_SOURCE_ID "2025-02-18 13:38:58 873d4e274b4988d260ba8354a9718324a1c26187a4ab4c1cc0227c03d0f10e70 "
149
+ #define SQLITE_VERSION "3.50.0 "
150
+ #define SQLITE_VERSION_NUMBER 3050000
151
+ #define SQLITE_SOURCE_ID "2025-05-29 14:26:00 dfc790f998f450d9c35e3ba1c8c89c17466cb559f87b0239e4aab9d34e28f742 "
152
152
153
153
/*
154
154
** CAPI3REF: Run-Time Library Version Numbers
@@ -1163,6 +1163,12 @@ struct sqlite3_io_methods {
1163
1163
** the value that M is to be set to. Before returning, the 32-bit signed
1164
1164
** integer is overwritten with the previous value of M.
1165
1165
**
1166
+ ** <li>[[SQLITE_FCNTL_BLOCK_ON_CONNECT]]
1167
+ ** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the
1168
+ ** VFS to block when taking a SHARED lock to connect to a wal mode database.
1169
+ ** This is used to implement the functionality associated with
1170
+ ** SQLITE_SETLK_BLOCK_ON_CONNECT.
1171
+ **
1166
1172
** <li>[[SQLITE_FCNTL_DATA_VERSION]]
1167
1173
** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to
1168
1174
** a database file. The argument is a pointer to a 32-bit unsigned integer.
@@ -1259,6 +1265,7 @@ struct sqlite3_io_methods {
1259
1265
#define SQLITE_FCNTL_CKSM_FILE 41
1260
1266
#define SQLITE_FCNTL_RESET_CACHE 42
1261
1267
#define SQLITE_FCNTL_NULL_IO 43
1268
+ #define SQLITE_FCNTL_BLOCK_ON_CONNECT 44
1262
1269
1263
1270
/* deprecated names */
1264
1271
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
@@ -1989,13 +1996,16 @@ struct sqlite3_mem_methods {
1989
1996
**
1990
1997
** [[SQLITE_CONFIG_LOOKASIDE]] <dt>SQLITE_CONFIG_LOOKASIDE</dt>
1991
1998
** <dd> ^(The SQLITE_CONFIG_LOOKASIDE option takes two arguments that determine
1992
- ** the default size of lookaside memory on each [database connection].
1999
+ ** the default size of [ lookaside memory] on each [database connection].
1993
2000
** The first argument is the
1994
- ** size of each lookaside buffer slot and the second is the number of
1995
- ** slots allocated to each database connection.)^ ^(SQLITE_CONFIG_LOOKASIDE
1996
- ** sets the <i>default</i> lookaside size. The [SQLITE_DBCONFIG_LOOKASIDE]
1997
- ** option to [sqlite3_db_config()] can be used to change the lookaside
1998
- ** configuration on individual connections.)^ </dd>
2001
+ ** size of each lookaside buffer slot ("sz") and the second is the number of
2002
+ ** slots allocated to each database connection ("cnt").)^
2003
+ ** ^(SQLITE_CONFIG_LOOKASIDE sets the <i>default</i> lookaside size.
2004
+ ** The [SQLITE_DBCONFIG_LOOKASIDE] option to [sqlite3_db_config()] can
2005
+ ** be used to change the lookaside configuration on individual connections.)^
2006
+ ** The [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to change the
2007
+ ** default lookaside configuration at compile-time.
2008
+ ** </dd>
1999
2009
**
2000
2010
** [[SQLITE_CONFIG_PCACHE2]] <dt>SQLITE_CONFIG_PCACHE2</dt>
2001
2011
** <dd> ^(The SQLITE_CONFIG_PCACHE2 option takes a single argument which is
@@ -2232,31 +2242,50 @@ struct sqlite3_mem_methods {
2232
2242
** [[SQLITE_DBCONFIG_LOOKASIDE]]
2233
2243
** <dt>SQLITE_DBCONFIG_LOOKASIDE</dt>
2234
2244
** <dd> The SQLITE_DBCONFIG_LOOKASIDE option is used to adjust the
2235
- ** configuration of the lookaside memory allocator within a database
2245
+ ** configuration of the [ lookaside memory allocator] within a database
2236
2246
** connection.
2237
2247
** The arguments to the SQLITE_DBCONFIG_LOOKASIDE option are <i>not</i>
2238
2248
** in the [DBCONFIG arguments|usual format].
2239
2249
** The SQLITE_DBCONFIG_LOOKASIDE option takes three arguments, not two,
2240
2250
** so that a call to [sqlite3_db_config()] that uses SQLITE_DBCONFIG_LOOKASIDE
2241
2251
** should have a total of five parameters.
2242
- ** ^The first argument (the third parameter to [sqlite3_db_config()] is a
2252
+ ** <ol>
2253
+ ** <li><p>The first argument ("buf") is a
2243
2254
** pointer to a memory buffer to use for lookaside memory.
2244
- ** ^The first argument after the SQLITE_DBCONFIG_LOOKASIDE verb
2245
- ** may be NULL in which case SQLite will allocate the
2246
- ** lookaside buffer itself using [sqlite3_malloc()]. ^The second argument is the
2247
- ** size of each lookaside buffer slot. ^The third argument is the number of
2248
- ** slots. The size of the buffer in the first argument must be greater than
2249
- ** or equal to the product of the second and third arguments. The buffer
2250
- ** must be aligned to an 8-byte boundary. ^If the second argument to
2251
- ** SQLITE_DBCONFIG_LOOKASIDE is not a multiple of 8, it is internally
2252
- ** rounded down to the next smaller multiple of 8. ^(The lookaside memory
2255
+ ** The first argument may be NULL in which case SQLite will allocate the
2256
+ ** lookaside buffer itself using [sqlite3_malloc()].
2257
+ ** <li><P>The second argument ("sz") is the
2258
+ ** size of each lookaside buffer slot. Lookaside is disabled if "sz"
2259
+ ** is less than 8. The "sz" argument should be a multiple of 8 less than
2260
+ ** 65536. If "sz" does not meet this constraint, it is reduced in size until
2261
+ ** it does.
2262
+ ** <li><p>The third argument ("cnt") is the number of slots. Lookaside is disabled
2263
+ ** if "cnt"is less than 1. The "cnt" value will be reduced, if necessary, so
2264
+ ** that the product of "sz" and "cnt" does not exceed 2,147,418,112. The "cnt"
2265
+ ** parameter is usually chosen so that the product of "sz" and "cnt" is less
2266
+ ** than 1,000,000.
2267
+ ** </ol>
2268
+ ** <p>If the "buf" argument is not NULL, then it must
2269
+ ** point to a memory buffer with a size that is greater than
2270
+ ** or equal to the product of "sz" and "cnt".
2271
+ ** The buffer must be aligned to an 8-byte boundary.
2272
+ ** The lookaside memory
2253
2273
** configuration for a database connection can only be changed when that
2254
2274
** connection is not currently using lookaside memory, or in other words
2255
- ** when the "current value" returned by
2256
- ** [sqlite3_db_status](D,[SQLITE_DBSTATUS_LOOKASIDE_USED],...) is zero.
2275
+ ** when the value returned by [SQLITE_DBSTATUS_LOOKASIDE_USED] is zero.
2257
2276
** Any attempt to change the lookaside memory configuration when lookaside
2258
2277
** memory is in use leaves the configuration unchanged and returns
2259
- ** [SQLITE_BUSY].)^</dd>
2278
+ ** [SQLITE_BUSY].
2279
+ ** If the "buf" argument is NULL and an attempt
2280
+ ** to allocate memory based on "sz" and "cnt" fails, then
2281
+ ** lookaside is silently disabled.
2282
+ ** <p>
2283
+ ** The [SQLITE_CONFIG_LOOKASIDE] configuration option can be used to set the
2284
+ ** default lookaside configuration at initialization. The
2285
+ ** [-DSQLITE_DEFAULT_LOOKASIDE] option can be used to set the default lookaside
2286
+ ** configuration at compile-time. Typical values for lookaside are 1200 for
2287
+ ** "sz" and 40 to 100 for "cnt".
2288
+ ** </dd>
2260
2289
**
2261
2290
** [[SQLITE_DBCONFIG_ENABLE_FKEY]]
2262
2291
** <dt>SQLITE_DBCONFIG_ENABLE_FKEY</dt>
@@ -2993,6 +3022,44 @@ SQLITE_API int sqlite3_busy_handler(sqlite3*,int(*)(void*,int),void*);
2993
3022
*/
2994
3023
SQLITE_API int sqlite3_busy_timeout(sqlite3*, int ms);
2995
3024
3025
+ /*
3026
+ ** CAPI3REF: Set the Setlk Timeout
3027
+ ** METHOD: sqlite3
3028
+ **
3029
+ ** This routine is only useful in SQLITE_ENABLE_SETLK_TIMEOUT builds. If
3030
+ ** the VFS supports blocking locks, it sets the timeout in ms used by
3031
+ ** eligible locks taken on wal mode databases by the specified database
3032
+ ** handle. In non-SQLITE_ENABLE_SETLK_TIMEOUT builds, or if the VFS does
3033
+ ** not support blocking locks, this function is a no-op.
3034
+ **
3035
+ ** Passing 0 to this function disables blocking locks altogether. Passing
3036
+ ** -1 to this function requests that the VFS blocks for a long time -
3037
+ ** indefinitely if possible. The results of passing any other negative value
3038
+ ** are undefined.
3039
+ **
3040
+ ** Internally, each SQLite database handle store two timeout values - the
3041
+ ** busy-timeout (used for rollback mode databases, or if the VFS does not
3042
+ ** support blocking locks) and the setlk-timeout (used for blocking locks
3043
+ ** on wal-mode databases). The sqlite3_busy_timeout() method sets both
3044
+ ** values, this function sets only the setlk-timeout value. Therefore,
3045
+ ** to configure separate busy-timeout and setlk-timeout values for a single
3046
+ ** database handle, call sqlite3_busy_timeout() followed by this function.
3047
+ **
3048
+ ** Whenever the number of connections to a wal mode database falls from
3049
+ ** 1 to 0, the last connection takes an exclusive lock on the database,
3050
+ ** then checkpoints and deletes the wal file. While it is doing this, any
3051
+ ** new connection that tries to read from the database fails with an
3052
+ ** SQLITE_BUSY error. Or, if the SQLITE_SETLK_BLOCK_ON_CONNECT flag is
3053
+ ** passed to this API, the new connection blocks until the exclusive lock
3054
+ ** has been released.
3055
+ */
3056
+ SQLITE_API int sqlite3_setlk_timeout(sqlite3*, int ms, int flags);
3057
+
3058
+ /*
3059
+ ** CAPI3REF: Flags for sqlite3_setlk_timeout()
3060
+ */
3061
+ #define SQLITE_SETLK_BLOCK_ON_CONNECT 0x01
3062
+
2996
3063
/*
2997
3064
** CAPI3REF: Convenience Routines For Running Queries
2998
3065
** METHOD: sqlite3
@@ -5108,7 +5175,7 @@ SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt*,int);
5108
5175
** other than [SQLITE_ROW] before any subsequent invocation of
5109
5176
** sqlite3_step(). Failure to reset the prepared statement using
5110
5177
** [sqlite3_reset()] would result in an [SQLITE_MISUSE] return from
5111
- ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1],
5178
+ ** sqlite3_step(). But after [version 3.6.23.1] ([dateof:3.6.23.1]) ,
5112
5179
** sqlite3_step() began
5113
5180
** calling [sqlite3_reset()] automatically in this circumstance rather
5114
5181
** than returning [SQLITE_MISUSE]. This is not considered a compatibility
@@ -7004,6 +7071,8 @@ SQLITE_API int sqlite3_autovacuum_pages(
7004
7071
**
7005
7072
** ^The second argument is a pointer to the function to invoke when a
7006
7073
** row is updated, inserted or deleted in a rowid table.
7074
+ ** ^The update hook is disabled by invoking sqlite3_update_hook()
7075
+ ** with a NULL pointer as the second parameter.
7007
7076
** ^The first argument to the callback is a copy of the third argument
7008
7077
** to sqlite3_update_hook().
7009
7078
** ^The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE],
@@ -11486,9 +11555,10 @@ SQLITE_API void sqlite3session_table_filter(
11486
11555
** is inserted while a session object is enabled, then later deleted while
11487
11556
** the same session object is disabled, no INSERT record will appear in the
11488
11557
** changeset, even though the delete took place while the session was disabled.
11489
- ** Or, if one field of a row is updated while a session is disabled, and
11490
- ** another field of the same row is updated while the session is enabled, the
11491
- ** resulting changeset will contain an UPDATE change that updates both fields.
11558
+ ** Or, if one field of a row is updated while a session is enabled, and
11559
+ ** then another field of the same row is updated while the session is disabled,
11560
+ ** the resulting changeset will contain an UPDATE change that updates both
11561
+ ** fields.
11492
11562
*/
11493
11563
SQLITE_API int sqlite3session_changeset(
11494
11564
sqlite3_session *pSession, /* Session object */
@@ -11560,8 +11630,9 @@ SQLITE_API sqlite3_int64 sqlite3session_changeset_size(sqlite3_session *pSession
11560
11630
** database zFrom the contents of the two compatible tables would be
11561
11631
** identical.
11562
11632
**
11563
- ** It an error if database zFrom does not exist or does not contain the
11564
- ** required compatible table.
11633
+ ** Unless the call to this function is a no-op as described above, it is an
11634
+ ** error if database zFrom does not exist or does not contain the required
11635
+ ** compatible table.
11565
11636
**
11566
11637
** If the operation is successful, SQLITE_OK is returned. Otherwise, an SQLite
11567
11638
** error code. In this case, if argument pzErrMsg is not NULL, *pzErrMsg
@@ -11696,7 +11767,7 @@ SQLITE_API int sqlite3changeset_start_v2(
11696
11767
** The following flags may passed via the 4th parameter to
11697
11768
** [sqlite3changeset_start_v2] and [sqlite3changeset_start_v2_strm]:
11698
11769
**
11699
- ** <dt>SQLITE_CHANGESETAPPLY_INVERT <dd>
11770
+ ** <dt>SQLITE_CHANGESETSTART_INVERT <dd>
11700
11771
** Invert the changeset while iterating through it. This is equivalent to
11701
11772
** inverting a changeset using sqlite3changeset_invert() before applying it.
11702
11773
** It is an error to specify this flag with a patchset.
@@ -12011,19 +12082,6 @@ SQLITE_API int sqlite3changeset_concat(
12011
12082
void **ppOut /* OUT: Buffer containing output changeset */
12012
12083
);
12013
12084
12014
-
12015
- /*
12016
- ** CAPI3REF: Upgrade the Schema of a Changeset/Patchset
12017
- */
12018
- SQLITE_API int sqlite3changeset_upgrade(
12019
- sqlite3 *db,
12020
- const char *zDb,
12021
- int nIn, const void *pIn, /* Input changeset */
12022
- int *pnOut, void **ppOut /* OUT: Inverse of input */
12023
- );
12024
-
12025
-
12026
-
12027
12085
/*
12028
12086
** CAPI3REF: Changegroup Handle
12029
12087
**
0 commit comments