| | @@ -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.40.0" |
| 456 | 456 | #define SQLITE_VERSION_NUMBER 3040000 |
| 457 | | -#define SQLITE_SOURCE_ID "2022-11-07 19:40:20 55a19677d723147aeb2b4a86bbd01756ddeb2072cba72c3145ad32d335e203b0" |
| 457 | +#define SQLITE_SOURCE_ID "2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318" |
| 458 | 458 | |
| 459 | 459 | /* |
| 460 | 460 | ** CAPI3REF: Run-Time Library Version Numbers |
| 461 | 461 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 462 | 462 | ** |
| | @@ -2643,10 +2643,11 @@ |
| 2643 | 2643 | ** deliberately corrupt the database file are disabled. The disabled |
| 2644 | 2644 | ** features include but are not limited to the following: |
| 2645 | 2645 | ** <ul> |
| 2646 | 2646 | ** <li> The [PRAGMA writable_schema=ON] statement. |
| 2647 | 2647 | ** <li> The [PRAGMA journal_mode=OFF] statement. |
| 2648 | +** <li> The [PRAGMA schema_version=N] statement. |
| 2648 | 2649 | ** <li> Writes to the [sqlite_dbpage] virtual table. |
| 2649 | 2650 | ** <li> Direct writes to [shadow tables]. |
| 2650 | 2651 | ** </ul> |
| 2651 | 2652 | ** </dd> |
| 2652 | 2653 | ** |
| | @@ -32534,14 +32535,14 @@ |
| 32534 | 32535 | |
| 32535 | 32536 | |
| 32536 | 32537 | /* The RFC-7539 ChaCha20 block function |
| 32537 | 32538 | */ |
| 32538 | 32539 | #define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b)))) |
| 32539 | | -#define QR(a, b, c, d) ( \ |
| 32540 | | - a += b, d ^= a, d = ROTL(d,16), \ |
| 32541 | | - c += d, b ^= c, b = ROTL(b,12), \ |
| 32542 | | - a += b, d ^= a, d = ROTL(d, 8), \ |
| 32540 | +#define QR(a, b, c, d) ( \ |
| 32541 | + a += b, d ^= a, d = ROTL(d,16), \ |
| 32542 | + c += d, b ^= c, b = ROTL(b,12), \ |
| 32543 | + a += b, d ^= a, d = ROTL(d, 8), \ |
| 32543 | 32544 | c += d, b ^= c, b = ROTL(b, 7)) |
| 32544 | 32545 | static void chacha_block(u32 *out, const u32 *in){ |
| 32545 | 32546 | int i; |
| 32546 | 32547 | u32 x[16]; |
| 32547 | 32548 | memcpy(x, in, 64); |
| | @@ -135517,10 +135518,15 @@ |
| 135517 | 135518 | aOp[0].p1 = iDb; |
| 135518 | 135519 | aOp[1].p1 = iDb; |
| 135519 | 135520 | aOp[1].p2 = iCookie; |
| 135520 | 135521 | aOp[1].p3 = sqlite3Atoi(zRight); |
| 135521 | 135522 | aOp[1].p5 = 1; |
| 135523 | + if( iCookie==BTREE_SCHEMA_VERSION && (db->flags & SQLITE_Defensive)!=0 ){ |
| 135524 | + /* Do not allow the use of PRAGMA schema_version=VALUE in defensive |
| 135525 | + ** mode. Change the OP_SetCookie opcode into a no-op. */ |
| 135526 | + aOp[1].opcode = OP_Noop; |
| 135527 | + } |
| 135522 | 135528 | }else{ |
| 135523 | 135529 | /* Read the specified cookie value */ |
| 135524 | 135530 | static const VdbeOpList readCookie[] = { |
| 135525 | 135531 | { OP_Transaction, 0, 0, 0}, /* 0 */ |
| 135526 | 135532 | { OP_ReadCookie, 0, 1, 0}, /* 1 */ |
| | @@ -210520,11 +210526,11 @@ |
| 210520 | 210526 | |
| 210521 | 210527 | if( p->rc==SQLITE_OK && rbuIsVacuum(p) ){ |
| 210522 | 210528 | sqlite3_file_control(p->dbRbu, "main", SQLITE_FCNTL_RBUCNT, (void*)p); |
| 210523 | 210529 | if( p->zState==0 ){ |
| 210524 | 210530 | const char *zFile = sqlite3_db_filename(p->dbRbu, "main"); |
| 210525 | | - p->zState = rbuMPrintf(p, "file://%s-vacuum?modeof=%s", zFile, zFile); |
| 210531 | + p->zState = rbuMPrintf(p, "file:///%s-vacuum?modeof=%s", zFile, zFile); |
| 210526 | 210532 | } |
| 210527 | 210533 | } |
| 210528 | 210534 | |
| 210529 | 210535 | /* If using separate RBU and state databases, attach the state database to |
| 210530 | 210536 | ** the RBU db handle now. */ |
| | @@ -235191,10 +235197,11 @@ |
| 235191 | 235197 | i64 iRowid = fts5MultiIterRowid(pIter); |
| 235192 | 235198 | char *z = (char*)fts5MultiIterTerm(pIter, &n); |
| 235193 | 235199 | |
| 235194 | 235200 | /* If this is a new term, query for it. Update cksum3 with the results. */ |
| 235195 | 235201 | fts5TestTerm(p, &term, z, n, cksum2, &cksum3); |
| 235202 | + if( p->rc ) break; |
| 235196 | 235203 | |
| 235197 | 235204 | if( eDetail==FTS5_DETAIL_NONE ){ |
| 235198 | 235205 | if( 0==fts5MultiIterIsEmpty(p, pIter) ){ |
| 235199 | 235206 | cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, 0, 0, -1, z, n); |
| 235200 | 235207 | } |
| | @@ -238528,11 +238535,11 @@ |
| 238528 | 238535 | int nArg, /* Number of args */ |
| 238529 | 238536 | sqlite3_value **apUnused /* Function arguments */ |
| 238530 | 238537 | ){ |
| 238531 | 238538 | assert( nArg==0 ); |
| 238532 | 238539 | UNUSED_PARAM2(nArg, apUnused); |
| 238533 | | - sqlite3_result_text(pCtx, "fts5: 2022-11-07 18:36:02 3645585f37631d60cefab1d55cdb1ee060aae87317b9b158a01329ca8a4d3e1e", -1, SQLITE_TRANSIENT); |
| 238540 | + sqlite3_result_text(pCtx, "fts5: 2022-11-16 12:10:08 89c459e766ea7e9165d0beeb124708b955a4950d0f4792f457465d71b158d318", -1, SQLITE_TRANSIENT); |
| 238534 | 238541 | } |
| 238535 | 238542 | |
| 238536 | 238543 | /* |
| 238537 | 238544 | ** Return true if zName is the extension on one of the shadow tables used |
| 238538 | 238545 | ** by this module. |
| 238539 | 238546 | |