| | @@ -452,11 +452,11 @@ |
| 452 | 452 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 453 | 453 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 454 | 454 | */ |
| 455 | 455 | #define SQLITE_VERSION "3.41.0" |
| 456 | 456 | #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" |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | ** CAPI3REF: Run-Time Library Version Numbers |
| 461 | 461 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 462 | 462 | ** |
| | @@ -1480,11 +1480,10 @@ |
| 1480 | 1480 | ** <li>[[SQLITE_FCNTL_CKPT_DONE]] |
| 1481 | 1481 | ** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint |
| 1482 | 1482 | ** in wal mode after the client has finished copying pages from the wal |
| 1483 | 1483 | ** file to the database file, but before the *-shm file is updated to |
| 1484 | 1484 | ** record the fact that the pages have been checkpointed. |
| 1485 | | -** </ul> |
| 1486 | 1485 | ** |
| 1487 | 1486 | ** <li>[[SQLITE_FCNTL_EXTERNAL_READER]] |
| 1488 | 1487 | ** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect |
| 1489 | 1488 | ** whether or not there is a database client in another process with a wal-mode |
| 1490 | 1489 | ** transaction open on the database or not. It is only available on unix.The |
| | @@ -1493,20 +1492,20 @@ |
| 1493 | 1492 | ** mode database and there exists at least one client in another process that |
| 1494 | 1493 | ** currently has an SQL transaction open on the database. It is set to 0 if |
| 1495 | 1494 | ** the database is not a wal-mode db, or if there is no such connection in any |
| 1496 | 1495 | ** other process. This opcode cannot be used to detect transactions opened |
| 1497 | 1496 | ** by clients within the current process, only within other processes. |
| 1498 | | -** </ul> |
| 1499 | 1497 | ** |
| 1500 | 1498 | ** <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. |
| 1502 | 1501 | ** |
| 1503 | 1502 | ** <li>[[SQLITE_FCNTL_RESET_CACHE]] |
| 1504 | 1503 | ** 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. |
| 1508 | 1507 | ** </ul> |
| 1509 | 1508 | */ |
| 1510 | 1509 | #define SQLITE_FCNTL_LOCKSTATE 1 |
| 1511 | 1510 | #define SQLITE_FCNTL_GET_LOCKPROXYFILE 2 |
| 1512 | 1511 | #define SQLITE_FCNTL_SET_LOCKPROXYFILE 3 |
| | @@ -10257,11 +10256,10 @@ |
| 10257 | 10256 | ** [[SQLITE_SCANSTAT_SELECTID]] <dt>SQLITE_SCANSTAT_SELECTID</dt> |
| 10258 | 10257 | ** <dd>^The "int" variable pointed to by the V parameter will be set to the |
| 10259 | 10258 | ** id for the X-th query plan element. The id value is unique within the |
| 10260 | 10259 | ** statement. The select-id is the same value as is output in the first |
| 10261 | 10260 | ** column of an [EXPLAIN QUERY PLAN] query. |
| 10262 | | -** </dl> |
| 10263 | 10261 | ** |
| 10264 | 10262 | ** [[SQLITE_SCANSTAT_PARENTID]] <dt>SQLITE_SCANSTAT_PARENTID</dt> |
| 10265 | 10263 | ** <dd>The "int" variable pointed to by the V parameter will be set to the |
| 10266 | 10264 | ** the id of the parent of the current query element, if applicable, or |
| 10267 | 10265 | ** to zero if the query element has no parent. This is the same value as |
| | @@ -10271,10 +10269,11 @@ |
| 10271 | 10269 | ** <dd>The sqlite3_int64 output value is set to the number of cycles, |
| 10272 | 10270 | ** according to the processor time-stamp counter, that elapsed while the |
| 10273 | 10271 | ** query element was being processed. This value is not available for |
| 10274 | 10272 | ** all query elements - if it is unavailable the output variable is |
| 10275 | 10273 | ** set to -1. |
| 10274 | +** </dl> |
| 10276 | 10275 | */ |
| 10277 | 10276 | #define SQLITE_SCANSTAT_NLOOP 0 |
| 10278 | 10277 | #define SQLITE_SCANSTAT_NVISIT 1 |
| 10279 | 10278 | #define SQLITE_SCANSTAT_EST 2 |
| 10280 | 10279 | #define SQLITE_SCANSTAT_NAME 3 |
| | @@ -10427,11 +10426,11 @@ |
| 10427 | 10426 | ** seventh parameter is the final rowid value of the row being inserted |
| 10428 | 10427 | ** or updated. The value of the seventh parameter passed to the callback |
| 10429 | 10428 | ** function is not defined for operations on WITHOUT ROWID tables, or for |
| 10430 | 10429 | ** DELETE operations on rowid tables. |
| 10431 | 10430 | ** |
| 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 |
| 10433 | 10432 | ** the previous call on the same [database connection] D, or NULL for |
| 10434 | 10433 | ** the first call on D. |
| 10435 | 10434 | ** |
| 10436 | 10435 | ** The [sqlite3_preupdate_old()], [sqlite3_preupdate_new()], |
| 10437 | 10436 | ** [sqlite3_preupdate_count()], and [sqlite3_preupdate_depth()] interfaces |
| | @@ -91383,11 +91382,11 @@ |
| 91383 | 91382 | #ifdef SQLITE_DEBUG |
| 91384 | 91383 | if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); } |
| 91385 | 91384 | #endif |
| 91386 | 91385 | |
| 91387 | 91386 | /* 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 |
| 91389 | 91388 | ** to bring this to the attention of fuzzers and other testing tools. */ |
| 91390 | 91389 | assert( pOp->p1!=SQLITE_INTERNAL ); |
| 91391 | 91390 | |
| 91392 | 91391 | if( p->pFrame && pOp->p1==SQLITE_OK ){ |
| 91393 | 91392 | /* Halt the sub-program. Return control to the parent frame. */ |
| | @@ -125988,11 +125987,11 @@ |
| 125988 | 125987 | const u8 *zPass = (const u8*)""; |
| 125989 | 125988 | int nPass = 0; |
| 125990 | 125989 | const u8 *zHex = sqlite3_value_text(argv[0]); |
| 125991 | 125990 | int nHex = sqlite3_value_bytes(argv[0]); |
| 125992 | 125991 | #ifdef SQLITE_DEBUG |
| 125993 | | - const u8 *zEnd = &zHex[nHex]; |
| 125992 | + const u8 *zEnd = zHex ? &zHex[nHex] : 0; |
| 125994 | 125993 | #endif |
| 125995 | 125994 | u8 *pBlob = 0; |
| 125996 | 125995 | u8 *p = 0; |
| 125997 | 125996 | |
| 125998 | 125997 | assert( argc==1 || argc==2 ); |
| | @@ -145034,10 +145033,11 @@ |
| 145034 | 145033 | assert( ExprUseUToken(pExpr) ); |
| 145035 | 145034 | if( sqlite3_stricmp(pExpr->u.zToken,"count") ) return 0; /* Is count() */ |
| 145036 | 145035 | assert( ExprUseXList(pExpr) ); |
| 145037 | 145036 | if( pExpr->x.pList!=0 ) return 0; /* Must be count(*) */ |
| 145038 | 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 | 145039 | pSub = p->pSrc->a[0].pSelect; |
| 145040 | 145040 | if( pSub==0 ) return 0; /* The FROM is a subquery */ |
| 145041 | 145041 | if( pSub->pPrior==0 ) return 0; /* Must be a compound ry */ |
| 145042 | 145042 | do{ |
| 145043 | 145043 | if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */ |
| | @@ -146097,11 +146097,11 @@ |
| 146097 | 146097 | sqlite3VdbeAddOp2(v, OP_SorterSort, pAggInfo->sortingIdx, addrEnd); |
| 146098 | 146098 | VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v); |
| 146099 | 146099 | pAggInfo->useSortingIdx = 1; |
| 146100 | 146100 | } |
| 146101 | 146101 | |
| 146102 | | - /* If there entries in pAgggInfo->aFunc[] that contain subexpressions |
| 146102 | + /* If there are entries in pAgggInfo->aFunc[] that contain subexpressions |
| 146103 | 146103 | ** that are indexed (and that were previously identified and tagged |
| 146104 | 146104 | ** in optimizeAggregateUseOfIndexedExpr()) then those subexpressions |
| 146105 | 146105 | ** must now be converted into a TK_AGG_COLUMN node so that the value |
| 146106 | 146106 | ** is correctly pulled from the index rather than being recomputed. */ |
| 146107 | 146107 | if( pParse->pIdxEpr ){ |
| | @@ -158983,11 +158983,11 @@ |
| 158983 | 158983 | nRowEst += nEst; |
| 158984 | 158984 | pBuilder->nRecValid = nRecValid; |
| 158985 | 158985 | } |
| 158986 | 158986 | |
| 158987 | 158987 | if( rc==SQLITE_OK ){ |
| 158988 | | - if( nRowEst > nRow0 ) nRowEst = nRow0; |
| 158988 | + if( nRowEst > (tRowcnt)nRow0 ) nRowEst = nRow0; |
| 158989 | 158989 | *pnRow = nRowEst; |
| 158990 | 158990 | WHERETRACE(0x20,("IN row estimate: est=%d\n", nRowEst)); |
| 158991 | 158991 | } |
| 158992 | 158992 | assert( pBuilder->nRecValid==nRecValid ); |
| 158993 | 158993 | return rc; |
| | @@ -240169,11 +240169,11 @@ |
| 240169 | 240169 | int nArg, /* Number of args */ |
| 240170 | 240170 | sqlite3_value **apUnused /* Function arguments */ |
| 240171 | 240171 | ){ |
| 240172 | 240172 | assert( nArg==0 ); |
| 240173 | 240173 | 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); |
| 240175 | 240175 | } |
| 240176 | 240176 | |
| 240177 | 240177 | /* |
| 240178 | 240178 | ** Return true if zName is the extension on one of the shadow tables used |
| 240179 | 240179 | ** by this module. |
| 240180 | 240180 | |