Fossil SCM

Update the built-in SQLite to the 3.41.0 release.

drh 2023-02-21 23:34 trunk
Commit 6d88833ffa120ac7c2f551d4d50e318abf6c2aff946704e2b82768423355d60a
+1 -1
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -21283,11 +21283,11 @@
2128321283
}
2128421284
sqlite3_finalize(pStmt);
2128521285
return res;
2128621286
}
2128721287
21288
-#if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
21288
+#if defined(SQLITE_SHELL_HAVE_RECOVER)
2128921289
/*
2129021290
** Convert a 2-byte or 4-byte big-endian integer into a native integer
2129121291
*/
2129221292
static unsigned int get2byteInt(unsigned char *a){
2129321293
return (a[0]<<8) + a[1];
2129421294
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -21283,11 +21283,11 @@
21283 }
21284 sqlite3_finalize(pStmt);
21285 return res;
21286 }
21287
21288 #if !defined(SQLITE_OMIT_VIRTUALTABLE) && defined(SQLITE_ENABLE_DBPAGE_VTAB)
21289 /*
21290 ** Convert a 2-byte or 4-byte big-endian integer into a native integer
21291 */
21292 static unsigned int get2byteInt(unsigned char *a){
21293 return (a[0]<<8) + a[1];
21294
--- extsrc/shell.c
+++ extsrc/shell.c
@@ -21283,11 +21283,11 @@
21283 }
21284 sqlite3_finalize(pStmt);
21285 return res;
21286 }
21287
21288 #if defined(SQLITE_SHELL_HAVE_RECOVER)
21289 /*
21290 ** Convert a 2-byte or 4-byte big-endian integer into a native integer
21291 */
21292 static unsigned int get2byteInt(unsigned char *a){
21293 return (a[0]<<8) + a[1];
21294
+14 -14
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452452
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453453
** [sqlite_version()] and [sqlite_source_id()].
454454
*/
455455
#define SQLITE_VERSION "3.41.0"
456456
#define SQLITE_VERSION_NUMBER 3041000
457
-#define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
457
+#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d"
458458
459459
/*
460460
** CAPI3REF: Run-Time Library Version Numbers
461461
** KEYWORDS: sqlite3_version sqlite3_sourceid
462462
**
@@ -1480,11 +1480,10 @@
14801480
** <li>[[SQLITE_FCNTL_CKPT_DONE]]
14811481
** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
14821482
** in wal mode after the client has finished copying pages from the wal
14831483
** file to the database file, but before the *-shm file is updated to
14841484
** record the fact that the pages have been checkpointed.
1485
-** </ul>
14861485
**
14871486
** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
14881487
** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
14891488
** whether or not there is a database client in another process with a wal-mode
14901489
** transaction open on the database or not. It is only available on unix.The
@@ -1493,20 +1492,20 @@
14931492
** mode database and there exists at least one client in another process that
14941493
** currently has an SQL transaction open on the database. It is set to 0 if
14951494
** the database is not a wal-mode db, or if there is no such connection in any
14961495
** other process. This opcode cannot be used to detect transactions opened
14971496
** by clients within the current process, only within other processes.
1498
-** </ul>
14991497
**
15001498
** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1501
-** Used by the cksmvfs VFS module only.
1499
+** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1500
+** [checksum VFS shim] only.
15021501
**
15031502
** <li>[[SQLITE_FCNTL_RESET_CACHE]]
15041503
** If there is currently no transaction open on the database, and the
1505
-** database is not a temp db, then this file-control purges the contents
1506
-** of the in-memory page cache. If there is an open transaction, or if
1507
-** the db is a temp-db, it is a no-op, not an error.
1504
+** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1505
+** purges the contents of the in-memory page cache. If there is an open
1506
+** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
15081507
** </ul>
15091508
*/
15101509
#define SQLITE_FCNTL_LOCKSTATE 1
15111510
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
15121511
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -10257,11 +10256,10 @@
1025710256
** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
1025810257
** <dd>^The "int" variable pointed to by the V parameter will be set to the
1025910258
** id for the X-th query plan element. The id value is unique within the
1026010259
** statement. The select-id is the same value as is output in the first
1026110260
** column of an [EXPLAIN QUERY PLAN] query.
10262
-** </dl>
1026310261
**
1026410262
** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
1026510263
** <dd>The "int" variable pointed to by the V parameter will be set to the
1026610264
** the id of the parent of the current query element, if applicable, or
1026710265
** to zero if the query element has no parent. This is the same value as
@@ -10271,10 +10269,11 @@
1027110269
** <dd>The sqlite3_int64 output value is set to the number of cycles,
1027210270
** according to the processor time-stamp counter, that elapsed while the
1027310271
** query element was being processed. This value is not available for
1027410272
** all query elements - if it is unavailable the output variable is
1027510273
** set to -1.
10274
+** </dl>
1027610275
*/
1027710276
#define SQLITE_SCANSTAT_NLOOP 0
1027810277
#define SQLITE_SCANSTAT_NVISIT 1
1027910278
#define SQLITE_SCANSTAT_EST 2
1028010279
#define SQLITE_SCANSTAT_NAME 3
@@ -10427,11 +10426,11 @@
1042710426
** seventh parameter is the final rowid value of the row being inserted
1042810427
** or updated. The value of the seventh parameter passed to the callback
1042910428
** function is not defined for operations on WITHOUT ROWID tables, or for
1043010429
** DELETE operations on rowid tables.
1043110430
**
10432
-** ^The sqlite3_update_hook(D,C,P) function returns the P argument from
10431
+** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
1043310432
** the previous call on the same [database connection] D, or NULL for
1043410433
** the first call on D.
1043510434
**
1043610435
** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
1043710436
** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
@@ -91383,11 +91382,11 @@
9138391382
#ifdef SQLITE_DEBUG
9138491383
if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
9138591384
#endif
9138691385
9138791386
/* A deliberately coded "OP_Halt SQLITE_INTERNAL * * * *" opcode indicates
91388
- ** something is wrong with the code generator. Raise and assertion in order
91387
+ ** something is wrong with the code generator. Raise an assertion in order
9138991388
** to bring this to the attention of fuzzers and other testing tools. */
9139091389
assert( pOp->p1!=SQLITE_INTERNAL );
9139191390
9139291391
if( p->pFrame && pOp->p1==SQLITE_OK ){
9139391392
/* Halt the sub-program. Return control to the parent frame. */
@@ -125988,11 +125987,11 @@
125988125987
const u8 *zPass = (const u8*)"";
125989125988
int nPass = 0;
125990125989
const u8 *zHex = sqlite3_value_text(argv[0]);
125991125990
int nHex = sqlite3_value_bytes(argv[0]);
125992125991
#ifdef SQLITE_DEBUG
125993
- const u8 *zEnd = &zHex[nHex];
125992
+ const u8 *zEnd = zHex ? &zHex[nHex] : 0;
125994125993
#endif
125995125994
u8 *pBlob = 0;
125996125995
u8 *p = 0;
125997125996
125998125997
assert( argc==1 || argc==2 );
@@ -145034,10 +145033,11 @@
145034145033
assert( ExprUseUToken(pExpr) );
145035145034
if( sqlite3_stricmp(pExpr->u.zToken,"count") ) return 0; /* Is count() */
145036145035
assert( ExprUseXList(pExpr) );
145037145036
if( pExpr->x.pList!=0 ) return 0; /* Must be count(*) */
145038145037
if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
145038
+ if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */
145039145039
pSub = p->pSrc->a[0].pSelect;
145040145040
if( pSub==0 ) return 0; /* The FROM is a subquery */
145041145041
if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */
145042145042
do{
145043145043
if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
@@ -146097,11 +146097,11 @@
146097146097
sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd);
146098146098
VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v);
146099146099
pAggInfo->useSortingIdx = 1;
146100146100
}
146101146101
146102
- /* If there entries in pAgggInfo->aFunc[] that contain subexpressions
146102
+ /* If there are entries in pAgggInfo->aFunc[] that contain subexpressions
146103146103
** that are indexed (and that were previously identified and tagged
146104146104
** in optimizeAggregateUseOfIndexedExpr()) then those subexpressions
146105146105
** must now be converted into a TK_AGG_COLUMN node so that the value
146106146106
** is correctly pulled from the index rather than being recomputed. */
146107146107
if( pParse->pIdxEpr ){
@@ -158983,11 +158983,11 @@
158983158983
nRowEst += nEst;
158984158984
pBuilder->nRecValid = nRecValid;
158985158985
}
158986158986
158987158987
if( rc==SQLITE_OK ){
158988
- if( nRowEst > nRow0 ) nRowEst = nRow0;
158988
+ if( nRowEst > (tRowcnt)nRow0 ) nRowEst = nRow0;
158989158989
*pnRow = nRowEst;
158990158990
WHERETRACE(0x20,("IN row estimate: est=%d\n", nRowEst));
158991158991
}
158992158992
assert( pBuilder->nRecValid==nRecValid );
158993158993
return rc;
@@ -240169,11 +240169,11 @@
240169240169
int nArg, /* Number of args */
240170240170
sqlite3_value **apUnused /* Function arguments */
240171240171
){
240172240172
assert( nArg==0 );
240173240173
UNUSED_PARAM2(nArg, apUnused);
240174
- sqlite3_result_text(pCtx, "fts5: 2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712", -1, SQLITE_TRANSIENT);
240174
+ sqlite3_result_text(pCtx, "fts5: 2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d", -1, SQLITE_TRANSIENT);
240175240175
}
240176240176
240177240177
/*
240178240178
** Return true if zName is the extension on one of the shadow tables used
240179240179
** by this module.
240180240180
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.41.0"
456 #define SQLITE_VERSION_NUMBER 3041000
457 #define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -1480,11 +1480,10 @@
1480 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1481 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1482 ** in wal mode after the client has finished copying pages from the wal
1483 ** file to the database file, but before the *-shm file is updated to
1484 ** record the fact that the pages have been checkpointed.
1485 ** </ul>
1486 **
1487 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1488 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1489 ** whether or not there is a database client in another process with a wal-mode
1490 ** transaction open on the database or not. It is only available on unix.The
@@ -1493,20 +1492,20 @@
1493 ** mode database and there exists at least one client in another process that
1494 ** currently has an SQL transaction open on the database. It is set to 0 if
1495 ** the database is not a wal-mode db, or if there is no such connection in any
1496 ** other process. This opcode cannot be used to detect transactions opened
1497 ** by clients within the current process, only within other processes.
1498 ** </ul>
1499 **
1500 ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1501 ** Used by the cksmvfs VFS module only.
 
1502 **
1503 ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1504 ** If there is currently no transaction open on the database, and the
1505 ** database is not a temp db, then this file-control purges the contents
1506 ** of the in-memory page cache. If there is an open transaction, or if
1507 ** the db is a temp-db, it is a no-op, not an error.
1508 ** </ul>
1509 */
1510 #define SQLITE_FCNTL_LOCKSTATE 1
1511 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1512 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -10257,11 +10256,10 @@
10257 ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
10258 ** <dd>^The "int" variable pointed to by the V parameter will be set to the
10259 ** id for the X-th query plan element. The id value is unique within the
10260 ** statement. The select-id is the same value as is output in the first
10261 ** column of an [EXPLAIN QUERY PLAN] query.
10262 ** </dl>
10263 **
10264 ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
10265 ** <dd>The "int" variable pointed to by the V parameter will be set to the
10266 ** the id of the parent of the current query element, if applicable, or
10267 ** to zero if the query element has no parent. This is the same value as
@@ -10271,10 +10269,11 @@
10271 ** <dd>The sqlite3_int64 output value is set to the number of cycles,
10272 ** according to the processor time-stamp counter, that elapsed while the
10273 ** query element was being processed. This value is not available for
10274 ** all query elements - if it is unavailable the output variable is
10275 ** set to -1.
 
10276 */
10277 #define SQLITE_SCANSTAT_NLOOP 0
10278 #define SQLITE_SCANSTAT_NVISIT 1
10279 #define SQLITE_SCANSTAT_EST 2
10280 #define SQLITE_SCANSTAT_NAME 3
@@ -10427,11 +10426,11 @@
10427 ** seventh parameter is the final rowid value of the row being inserted
10428 ** or updated. The value of the seventh parameter passed to the callback
10429 ** function is not defined for operations on WITHOUT ROWID tables, or for
10430 ** DELETE operations on rowid tables.
10431 **
10432 ** ^The sqlite3_update_hook(D,C,P) function returns the P argument from
10433 ** the previous call on the same [database connection] D, or NULL for
10434 ** the first call on D.
10435 **
10436 ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10437 ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
@@ -91383,11 +91382,11 @@
91383 #ifdef SQLITE_DEBUG
91384 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
91385 #endif
91386
91387 /* A deliberately coded "OP_Halt SQLITE_INTERNAL * * * *" opcode indicates
91388 ** something is wrong with the code generator. Raise and assertion in order
91389 ** to bring this to the attention of fuzzers and other testing tools. */
91390 assert( pOp->p1!=SQLITE_INTERNAL );
91391
91392 if( p->pFrame && pOp->p1==SQLITE_OK ){
91393 /* Halt the sub-program. Return control to the parent frame. */
@@ -125988,11 +125987,11 @@
125988 const u8 *zPass = (const u8*)"";
125989 int nPass = 0;
125990 const u8 *zHex = sqlite3_value_text(argv[0]);
125991 int nHex = sqlite3_value_bytes(argv[0]);
125992 #ifdef SQLITE_DEBUG
125993 const u8 *zEnd = &zHex[nHex];
125994 #endif
125995 u8 *pBlob = 0;
125996 u8 *p = 0;
125997
125998 assert( argc==1 || argc==2 );
@@ -145034,10 +145033,11 @@
145034 assert( ExprUseUToken(pExpr) );
145035 if( sqlite3_stricmp(pExpr->u.zToken,"count") ) return 0; /* Is count() */
145036 assert( ExprUseXList(pExpr) );
145037 if( pExpr->x.pList!=0 ) return 0; /* Must be count(*) */
145038 if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
 
145039 pSub = p->pSrc->a[0].pSelect;
145040 if( pSub==0 ) return 0; /* The FROM is a subquery */
145041 if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */
145042 do{
145043 if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
@@ -146097,11 +146097,11 @@
146097 sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd);
146098 VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v);
146099 pAggInfo->useSortingIdx = 1;
146100 }
146101
146102 /* If there entries in pAgggInfo->aFunc[] that contain subexpressions
146103 ** that are indexed (and that were previously identified and tagged
146104 ** in optimizeAggregateUseOfIndexedExpr()) then those subexpressions
146105 ** must now be converted into a TK_AGG_COLUMN node so that the value
146106 ** is correctly pulled from the index rather than being recomputed. */
146107 if( pParse->pIdxEpr ){
@@ -158983,11 +158983,11 @@
158983 nRowEst += nEst;
158984 pBuilder->nRecValid = nRecValid;
158985 }
158986
158987 if( rc==SQLITE_OK ){
158988 if( nRowEst > nRow0 ) nRowEst = nRow0;
158989 *pnRow = nRowEst;
158990 WHERETRACE(0x20,("IN row estimate: est=%d\n", nRowEst));
158991 }
158992 assert( pBuilder->nRecValid==nRecValid );
158993 return rc;
@@ -240169,11 +240169,11 @@
240169 int nArg, /* Number of args */
240170 sqlite3_value **apUnused /* Function arguments */
240171 ){
240172 assert( nArg==0 );
240173 UNUSED_PARAM2(nArg, apUnused);
240174 sqlite3_result_text(pCtx, "fts5: 2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712", -1, SQLITE_TRANSIENT);
240175 }
240176
240177 /*
240178 ** Return true if zName is the extension on one of the shadow tables used
240179 ** by this module.
240180
--- extsrc/sqlite3.c
+++ extsrc/sqlite3.c
@@ -452,11 +452,11 @@
452 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
453 ** [sqlite_version()] and [sqlite_source_id()].
454 */
455 #define SQLITE_VERSION "3.41.0"
456 #define SQLITE_VERSION_NUMBER 3041000
457 #define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d"
458
459 /*
460 ** CAPI3REF: Run-Time Library Version Numbers
461 ** KEYWORDS: sqlite3_version sqlite3_sourceid
462 **
@@ -1480,11 +1480,10 @@
1480 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1481 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1482 ** in wal mode after the client has finished copying pages from the wal
1483 ** file to the database file, but before the *-shm file is updated to
1484 ** record the fact that the pages have been checkpointed.
 
1485 **
1486 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1487 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1488 ** whether or not there is a database client in another process with a wal-mode
1489 ** transaction open on the database or not. It is only available on unix.The
@@ -1493,20 +1492,20 @@
1492 ** mode database and there exists at least one client in another process that
1493 ** currently has an SQL transaction open on the database. It is set to 0 if
1494 ** the database is not a wal-mode db, or if there is no such connection in any
1495 ** other process. This opcode cannot be used to detect transactions opened
1496 ** by clients within the current process, only within other processes.
 
1497 **
1498 ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1499 ** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1500 ** [checksum VFS shim] only.
1501 **
1502 ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1503 ** If there is currently no transaction open on the database, and the
1504 ** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1505 ** purges the contents of the in-memory page cache. If there is an open
1506 ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
1507 ** </ul>
1508 */
1509 #define SQLITE_FCNTL_LOCKSTATE 1
1510 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1511 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -10257,11 +10256,10 @@
10256 ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
10257 ** <dd>^The "int" variable pointed to by the V parameter will be set to the
10258 ** id for the X-th query plan element. The id value is unique within the
10259 ** statement. The select-id is the same value as is output in the first
10260 ** column of an [EXPLAIN QUERY PLAN] query.
 
10261 **
10262 ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
10263 ** <dd>The "int" variable pointed to by the V parameter will be set to the
10264 ** the id of the parent of the current query element, if applicable, or
10265 ** to zero if the query element has no parent. This is the same value as
@@ -10271,10 +10269,11 @@
10269 ** <dd>The sqlite3_int64 output value is set to the number of cycles,
10270 ** according to the processor time-stamp counter, that elapsed while the
10271 ** query element was being processed. This value is not available for
10272 ** all query elements - if it is unavailable the output variable is
10273 ** set to -1.
10274 ** </dl>
10275 */
10276 #define SQLITE_SCANSTAT_NLOOP 0
10277 #define SQLITE_SCANSTAT_NVISIT 1
10278 #define SQLITE_SCANSTAT_EST 2
10279 #define SQLITE_SCANSTAT_NAME 3
@@ -10427,11 +10426,11 @@
10426 ** seventh parameter is the final rowid value of the row being inserted
10427 ** or updated. The value of the seventh parameter passed to the callback
10428 ** function is not defined for operations on WITHOUT ROWID tables, or for
10429 ** DELETE operations on rowid tables.
10430 **
10431 ** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
10432 ** the previous call on the same [database connection] D, or NULL for
10433 ** the first call on D.
10434 **
10435 ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10436 ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
@@ -91383,11 +91382,11 @@
91382 #ifdef SQLITE_DEBUG
91383 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }
91384 #endif
91385
91386 /* A deliberately coded "OP_Halt SQLITE_INTERNAL * * * *" opcode indicates
91387 ** something is wrong with the code generator. Raise an assertion in order
91388 ** to bring this to the attention of fuzzers and other testing tools. */
91389 assert( pOp->p1!=SQLITE_INTERNAL );
91390
91391 if( p->pFrame && pOp->p1==SQLITE_OK ){
91392 /* Halt the sub-program. Return control to the parent frame. */
@@ -125988,11 +125987,11 @@
125987 const u8 *zPass = (const u8*)"";
125988 int nPass = 0;
125989 const u8 *zHex = sqlite3_value_text(argv[0]);
125990 int nHex = sqlite3_value_bytes(argv[0]);
125991 #ifdef SQLITE_DEBUG
125992 const u8 *zEnd = zHex ? &zHex[nHex] : 0;
125993 #endif
125994 u8 *pBlob = 0;
125995 u8 *p = 0;
125996
125997 assert( argc==1 || argc==2 );
@@ -145034,10 +145033,11 @@
145033 assert( ExprUseUToken(pExpr) );
145034 if( sqlite3_stricmp(pExpr->u.zToken,"count") ) return 0; /* Is count() */
145035 assert( ExprUseXList(pExpr) );
145036 if( pExpr->x.pList!=0 ) return 0; /* Must be count(*) */
145037 if( p->pSrc->nSrc!=1 ) return 0; /* One table in FROM */
145038 if( ExprHasProperty(pExpr, EP_WinFunc) ) return 0;/* Not a window function */
145039 pSub = p->pSrc->a[0].pSelect;
145040 if( pSub==0 ) return 0; /* The FROM is a subquery */
145041 if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */
145042 do{
145043 if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
@@ -146097,11 +146097,11 @@
146097 sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd);
146098 VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v);
146099 pAggInfo->useSortingIdx = 1;
146100 }
146101
146102 /* If there are entries in pAgggInfo->aFunc[] that contain subexpressions
146103 ** that are indexed (and that were previously identified and tagged
146104 ** in optimizeAggregateUseOfIndexedExpr()) then those subexpressions
146105 ** must now be converted into a TK_AGG_COLUMN node so that the value
146106 ** is correctly pulled from the index rather than being recomputed. */
146107 if( pParse->pIdxEpr ){
@@ -158983,11 +158983,11 @@
158983 nRowEst += nEst;
158984 pBuilder->nRecValid = nRecValid;
158985 }
158986
158987 if( rc==SQLITE_OK ){
158988 if( nRowEst > (tRowcnt)nRow0 ) nRowEst = nRow0;
158989 *pnRow = nRowEst;
158990 WHERETRACE(0x20,("IN row estimate: est=%d\n", nRowEst));
158991 }
158992 assert( pBuilder->nRecValid==nRecValid );
158993 return rc;
@@ -240169,11 +240169,11 @@
240169 int nArg, /* Number of args */
240170 sqlite3_value **apUnused /* Function arguments */
240171 ){
240172 assert( nArg==0 );
240173 UNUSED_PARAM2(nArg, apUnused);
240174 sqlite3_result_text(pCtx, "fts5: 2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d", -1, SQLITE_TRANSIENT);
240175 }
240176
240177 /*
240178 ** Return true if zName is the extension on one of the shadow tables used
240179 ** by this module.
240180
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146146
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147147
** [sqlite_version()] and [sqlite_source_id()].
148148
*/
149149
#define SQLITE_VERSION "3.41.0"
150150
#define SQLITE_VERSION_NUMBER 3041000
151
-#define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
151
+#define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d"
152152
153153
/*
154154
** CAPI3REF: Run-Time Library Version Numbers
155155
** KEYWORDS: sqlite3_version sqlite3_sourceid
156156
**
@@ -1174,11 +1174,10 @@
11741174
** <li>[[SQLITE_FCNTL_CKPT_DONE]]
11751175
** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
11761176
** in wal mode after the client has finished copying pages from the wal
11771177
** file to the database file, but before the *-shm file is updated to
11781178
** record the fact that the pages have been checkpointed.
1179
-** </ul>
11801179
**
11811180
** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
11821181
** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
11831182
** whether or not there is a database client in another process with a wal-mode
11841183
** transaction open on the database or not. It is only available on unix.The
@@ -1187,20 +1186,20 @@
11871186
** mode database and there exists at least one client in another process that
11881187
** currently has an SQL transaction open on the database. It is set to 0 if
11891188
** the database is not a wal-mode db, or if there is no such connection in any
11901189
** other process. This opcode cannot be used to detect transactions opened
11911190
** by clients within the current process, only within other processes.
1192
-** </ul>
11931191
**
11941192
** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1195
-** Used by the cksmvfs VFS module only.
1193
+** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1194
+** [checksum VFS shim] only.
11961195
**
11971196
** <li>[[SQLITE_FCNTL_RESET_CACHE]]
11981197
** If there is currently no transaction open on the database, and the
1199
-** database is not a temp db, then this file-control purges the contents
1200
-** of the in-memory page cache. If there is an open transaction, or if
1201
-** the db is a temp-db, it is a no-op, not an error.
1198
+** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1199
+** purges the contents of the in-memory page cache. If there is an open
1200
+** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
12021201
** </ul>
12031202
*/
12041203
#define SQLITE_FCNTL_LOCKSTATE 1
12051204
#define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
12061205
#define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -9951,11 +9950,10 @@
99519950
** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
99529951
** <dd>^The "int" variable pointed to by the V parameter will be set to the
99539952
** id for the X-th query plan element. The id value is unique within the
99549953
** statement. The select-id is the same value as is output in the first
99559954
** column of an [EXPLAIN QUERY PLAN] query.
9956
-** </dl>
99579955
**
99589956
** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
99599957
** <dd>The "int" variable pointed to by the V parameter will be set to the
99609958
** the id of the parent of the current query element, if applicable, or
99619959
** to zero if the query element has no parent. This is the same value as
@@ -9965,10 +9963,11 @@
99659963
** <dd>The sqlite3_int64 output value is set to the number of cycles,
99669964
** according to the processor time-stamp counter, that elapsed while the
99679965
** query element was being processed. This value is not available for
99689966
** all query elements - if it is unavailable the output variable is
99699967
** set to -1.
9968
+** </dl>
99709969
*/
99719970
#define SQLITE_SCANSTAT_NLOOP 0
99729971
#define SQLITE_SCANSTAT_NVISIT 1
99739972
#define SQLITE_SCANSTAT_EST 2
99749973
#define SQLITE_SCANSTAT_NAME 3
@@ -10121,11 +10120,11 @@
1012110120
** seventh parameter is the final rowid value of the row being inserted
1012210121
** or updated. The value of the seventh parameter passed to the callback
1012310122
** function is not defined for operations on WITHOUT ROWID tables, or for
1012410123
** DELETE operations on rowid tables.
1012510124
**
10126
-** ^The sqlite3_update_hook(D,C,P) function returns the P argument from
10125
+** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
1012710126
** the previous call on the same [database connection] D, or NULL for
1012810127
** the first call on D.
1012910128
**
1013010129
** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
1013110130
** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
1013210131
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.41.0"
150 #define SQLITE_VERSION_NUMBER 3041000
151 #define SQLITE_SOURCE_ID "2023-02-13 19:32:40 ecdeef43b27412b0b0b09e09a62ad3a03836a3fc80f2070268090e7ca8f02712"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -1174,11 +1174,10 @@
1174 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1175 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1176 ** in wal mode after the client has finished copying pages from the wal
1177 ** file to the database file, but before the *-shm file is updated to
1178 ** record the fact that the pages have been checkpointed.
1179 ** </ul>
1180 **
1181 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1182 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1183 ** whether or not there is a database client in another process with a wal-mode
1184 ** transaction open on the database or not. It is only available on unix.The
@@ -1187,20 +1186,20 @@
1187 ** mode database and there exists at least one client in another process that
1188 ** currently has an SQL transaction open on the database. It is set to 0 if
1189 ** the database is not a wal-mode db, or if there is no such connection in any
1190 ** other process. This opcode cannot be used to detect transactions opened
1191 ** by clients within the current process, only within other processes.
1192 ** </ul>
1193 **
1194 ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1195 ** Used by the cksmvfs VFS module only.
 
1196 **
1197 ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1198 ** If there is currently no transaction open on the database, and the
1199 ** database is not a temp db, then this file-control purges the contents
1200 ** of the in-memory page cache. If there is an open transaction, or if
1201 ** the db is a temp-db, it is a no-op, not an error.
1202 ** </ul>
1203 */
1204 #define SQLITE_FCNTL_LOCKSTATE 1
1205 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1206 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -9951,11 +9950,10 @@
9951 ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
9952 ** <dd>^The "int" variable pointed to by the V parameter will be set to the
9953 ** id for the X-th query plan element. The id value is unique within the
9954 ** statement. The select-id is the same value as is output in the first
9955 ** column of an [EXPLAIN QUERY PLAN] query.
9956 ** </dl>
9957 **
9958 ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
9959 ** <dd>The "int" variable pointed to by the V parameter will be set to the
9960 ** the id of the parent of the current query element, if applicable, or
9961 ** to zero if the query element has no parent. This is the same value as
@@ -9965,10 +9963,11 @@
9965 ** <dd>The sqlite3_int64 output value is set to the number of cycles,
9966 ** according to the processor time-stamp counter, that elapsed while the
9967 ** query element was being processed. This value is not available for
9968 ** all query elements - if it is unavailable the output variable is
9969 ** set to -1.
 
9970 */
9971 #define SQLITE_SCANSTAT_NLOOP 0
9972 #define SQLITE_SCANSTAT_NVISIT 1
9973 #define SQLITE_SCANSTAT_EST 2
9974 #define SQLITE_SCANSTAT_NAME 3
@@ -10121,11 +10120,11 @@
10121 ** seventh parameter is the final rowid value of the row being inserted
10122 ** or updated. The value of the seventh parameter passed to the callback
10123 ** function is not defined for operations on WITHOUT ROWID tables, or for
10124 ** DELETE operations on rowid tables.
10125 **
10126 ** ^The sqlite3_update_hook(D,C,P) function returns the P argument from
10127 ** the previous call on the same [database connection] D, or NULL for
10128 ** the first call on D.
10129 **
10130 ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10131 ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
10132
--- extsrc/sqlite3.h
+++ extsrc/sqlite3.h
@@ -146,11 +146,11 @@
146 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
147 ** [sqlite_version()] and [sqlite_source_id()].
148 */
149 #define SQLITE_VERSION "3.41.0"
150 #define SQLITE_VERSION_NUMBER 3041000
151 #define SQLITE_SOURCE_ID "2023-02-21 18:09:37 05941c2a04037fc3ed2ffae11f5d2260706f89431f463518740f72ada350866d"
152
153 /*
154 ** CAPI3REF: Run-Time Library Version Numbers
155 ** KEYWORDS: sqlite3_version sqlite3_sourceid
156 **
@@ -1174,11 +1174,10 @@
1174 ** <li>[[SQLITE_FCNTL_CKPT_DONE]]
1175 ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint
1176 ** in wal mode after the client has finished copying pages from the wal
1177 ** file to the database file, but before the *-shm file is updated to
1178 ** record the fact that the pages have been checkpointed.
 
1179 **
1180 ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]]
1181 ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect
1182 ** whether or not there is a database client in another process with a wal-mode
1183 ** transaction open on the database or not. It is only available on unix.The
@@ -1187,20 +1186,20 @@
1186 ** mode database and there exists at least one client in another process that
1187 ** currently has an SQL transaction open on the database. It is set to 0 if
1188 ** the database is not a wal-mode db, or if there is no such connection in any
1189 ** other process. This opcode cannot be used to detect transactions opened
1190 ** by clients within the current process, only within other processes.
 
1191 **
1192 ** <li>[[SQLITE_FCNTL_CKSM_FILE]]
1193 ** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use interally by the
1194 ** [checksum VFS shim] only.
1195 **
1196 ** <li>[[SQLITE_FCNTL_RESET_CACHE]]
1197 ** If there is currently no transaction open on the database, and the
1198 ** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control
1199 ** purges the contents of the in-memory page cache. If there is an open
1200 ** transaction, or if the db is a temp-db, this opcode is a no-op, not an error.
1201 ** </ul>
1202 */
1203 #define SQLITE_FCNTL_LOCKSTATE 1
1204 #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2
1205 #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3
@@ -9951,11 +9950,10 @@
9950 ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt>
9951 ** <dd>^The "int" variable pointed to by the V parameter will be set to the
9952 ** id for the X-th query plan element. The id value is unique within the
9953 ** statement. The select-id is the same value as is output in the first
9954 ** column of an [EXPLAIN QUERY PLAN] query.
 
9955 **
9956 ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt>
9957 ** <dd>The "int" variable pointed to by the V parameter will be set to the
9958 ** the id of the parent of the current query element, if applicable, or
9959 ** to zero if the query element has no parent. This is the same value as
@@ -9965,10 +9963,11 @@
9963 ** <dd>The sqlite3_int64 output value is set to the number of cycles,
9964 ** according to the processor time-stamp counter, that elapsed while the
9965 ** query element was being processed. This value is not available for
9966 ** all query elements - if it is unavailable the output variable is
9967 ** set to -1.
9968 ** </dl>
9969 */
9970 #define SQLITE_SCANSTAT_NLOOP 0
9971 #define SQLITE_SCANSTAT_NVISIT 1
9972 #define SQLITE_SCANSTAT_EST 2
9973 #define SQLITE_SCANSTAT_NAME 3
@@ -10121,11 +10120,11 @@
10120 ** seventh parameter is the final rowid value of the row being inserted
10121 ** or updated. The value of the seventh parameter passed to the callback
10122 ** function is not defined for operations on WITHOUT ROWID tables, or for
10123 ** DELETE operations on rowid tables.
10124 **
10125 ** ^The sqlite3_preupdate_hook(D,C,P) function returns the P argument from
10126 ** the previous call on the same [database connection] D, or NULL for
10127 ** the first call on D.
10128 **
10129 ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()],
10130 ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces
10131

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button