Fossil SCM
Update the built-in SQLite to fix a bug in json_remove(). This probably does not affect Fossil, but better safe than sorry.
Commit
d3c850cf52ab1033a186eb904207a6c33db00945be047930e8cf6328b0b86ca1
Parent
57d3dbb11b514ad…
2 files changed
+42
-24
+2
-2
+42
-24
| --- extsrc/sqlite3.c | ||
| +++ extsrc/sqlite3.c | ||
| @@ -16,11 +16,11 @@ | ||
| 16 | 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | 19 | ** |
| 20 | 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | -** a0b9aecbaca9a8e784fd2bcb50f78cbdcf4. | |
| 21 | +** a7a66db13b28da0b41f03be825a59360847. | |
| 22 | 22 | */ |
| 23 | 23 | #define SQLITE_CORE 1 |
| 24 | 24 | #define SQLITE_AMALGAMATION 1 |
| 25 | 25 | #ifndef SQLITE_PRIVATE |
| 26 | 26 | # define SQLITE_PRIVATE static |
| @@ -459,11 +459,11 @@ | ||
| 459 | 459 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 460 | 460 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 461 | 461 | */ |
| 462 | 462 | #define SQLITE_VERSION "3.43.0" |
| 463 | 463 | #define SQLITE_VERSION_NUMBER 3043000 |
| 464 | -#define SQLITE_SOURCE_ID "2023-08-02 16:06:02 ea0b9aecbaca9a8e784fd2bcb50f78cbdcf4c5cfb45a7700bb222e4cc104c644" | |
| 464 | +#define SQLITE_SOURCE_ID "2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65" | |
| 465 | 465 | |
| 466 | 466 | /* |
| 467 | 467 | ** CAPI3REF: Run-Time Library Version Numbers |
| 468 | 468 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 469 | 469 | ** |
| @@ -13116,11 +13116,11 @@ | ||
| 13116 | 13116 | ** |
| 13117 | 13117 | ** xPhraseNextColumn() |
| 13118 | 13118 | ** See xPhraseFirstColumn above. |
| 13119 | 13119 | */ |
| 13120 | 13120 | struct Fts5ExtensionApi { |
| 13121 | - int iVersion; /* Currently always set to 3 */ | |
| 13121 | + int iVersion; /* Currently always set to 2 */ | |
| 13122 | 13122 | |
| 13123 | 13123 | void *(*xUserData)(Fts5Context*); |
| 13124 | 13124 | |
| 13125 | 13125 | int (*xColumnCount)(Fts5Context*); |
| 13126 | 13126 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -44325,16 +44325,21 @@ | ||
| 44325 | 44325 | ** requested from the underlying operating system, a number which |
| 44326 | 44326 | ** might be greater than or equal to the argument, but not less |
| 44327 | 44327 | ** than the argument. |
| 44328 | 44328 | */ |
| 44329 | 44329 | static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ |
| 44330 | -#if OS_VXWORKS || _POSIX_C_SOURCE >= 199309L | |
| 44330 | +#if !defined(HAVE_NANOSLEEP) || HAVE_NANOSLEEP+0 | |
| 44331 | 44331 | struct timespec sp; |
| 44332 | - | |
| 44333 | 44332 | sp.tv_sec = microseconds / 1000000; |
| 44334 | 44333 | sp.tv_nsec = (microseconds % 1000000) * 1000; |
| 44334 | + | |
| 44335 | + /* Almost all modern unix systems support nanosleep(). But if you are | |
| 44336 | + ** compiling for one of the rare exceptions, you can use | |
| 44337 | + ** -DHAVE_NANOSLEEP=0 (perhaps in conjuction with -DHAVE_USLEEP if | |
| 44338 | + ** usleep() is available) in order to bypass the use of nanosleep() */ | |
| 44335 | 44339 | nanosleep(&sp, NULL); |
| 44340 | + | |
| 44336 | 44341 | UNUSED_PARAMETER(NotUsed); |
| 44337 | 44342 | return microseconds; |
| 44338 | 44343 | #elif defined(HAVE_USLEEP) && HAVE_USLEEP |
| 44339 | 44344 | if( microseconds>=1000000 ) sleep(microseconds/1000000); |
| 44340 | 44345 | if( microseconds%1000000 ) usleep(microseconds%1000000); |
| @@ -94528,11 +94533,11 @@ | ||
| 94528 | 94533 | if( ((p5 = (pOp->p5 & OPFLAG_BYTELENARG))!=0 |
| 94529 | 94534 | && (p5==OPFLAG_TYPEOFARG |
| 94530 | 94535 | || (t>=12 && ((t&1)==0 || p5==OPFLAG_BYTELENARG)) |
| 94531 | 94536 | ) |
| 94532 | 94537 | ) |
| 94533 | - || (len = sqlite3VdbeSerialTypeLen(t))==0 | |
| 94538 | + || sqlite3VdbeSerialTypeLen(t)==0 | |
| 94534 | 94539 | ){ |
| 94535 | 94540 | /* Content is irrelevant for |
| 94536 | 94541 | ** 1. the typeof() function, |
| 94537 | 94542 | ** 2. the length(X) function if X is a blob, and |
| 94538 | 94543 | ** 3. if the content length is zero. |
| @@ -177637,13 +177642,13 @@ | ||
| 177637 | 177642 | */ |
| 177638 | 177643 | static int sqliteDefaultBusyCallback( |
| 177639 | 177644 | void *ptr, /* Database connection */ |
| 177640 | 177645 | int count /* Number of times table has been busy */ |
| 177641 | 177646 | ){ |
| 177642 | -#if SQLITE_OS_WIN || HAVE_USLEEP | |
| 177647 | +#if SQLITE_OS_WIN || !defined(HAVE_NANOSLEEP) || HAVE_NANOSLEEP | |
| 177643 | 177648 | /* This case is for systems that have support for sleeping for fractions of |
| 177644 | - ** a second. Examples: All windows systems, unix systems with usleep() */ | |
| 177649 | + ** a second. Examples: All windows systems, unix systems with nanosleep() */ | |
| 177645 | 177650 | static const u8 delays[] = |
| 177646 | 177651 | { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; |
| 177647 | 177652 | static const u8 totals[] = |
| 177648 | 177653 | { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; |
| 177649 | 177654 | # define NDELAY ArraySize(delays) |
| @@ -180132,14 +180137,16 @@ | ||
| 180132 | 180137 | sqlite3ShowExprList(0); |
| 180133 | 180138 | sqlite3ShowIdList(0); |
| 180134 | 180139 | sqlite3ShowSrcList(0); |
| 180135 | 180140 | sqlite3ShowWith(0); |
| 180136 | 180141 | sqlite3ShowUpsert(0); |
| 180142 | +#ifndef SQLITE_OMIT_TRIGGER | |
| 180137 | 180143 | sqlite3ShowTriggerStep(0); |
| 180138 | 180144 | sqlite3ShowTriggerStepList(0); |
| 180139 | 180145 | sqlite3ShowTrigger(0); |
| 180140 | 180146 | sqlite3ShowTriggerList(0); |
| 180147 | +#endif | |
| 180141 | 180148 | #ifndef SQLITE_OMIT_WINDOWFUNC |
| 180142 | 180149 | sqlite3ShowWindow(0); |
| 180143 | 180150 | sqlite3ShowWinFunc(0); |
| 180144 | 180151 | #endif |
| 180145 | 180152 | sqlite3ShowSelect(0); |
| @@ -180442,10 +180449,11 @@ | ||
| 180442 | 180449 | *pU64 = sqlite3LogEstToInt(rLogEst); |
| 180443 | 180450 | *pI2 = sqlite3LogEst(*pU64); |
| 180444 | 180451 | break; |
| 180445 | 180452 | } |
| 180446 | 180453 | |
| 180454 | +#if !defined(SQLITE_OMIT_WSD) | |
| 180447 | 180455 | /* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X); |
| 180448 | 180456 | ** |
| 180449 | 180457 | ** X<0 Make no changes to the bUseLongDouble. Just report value. |
| 180450 | 180458 | ** X==0 Disable bUseLongDouble |
| 180451 | 180459 | ** X==1 Enable bUseLongDouble |
| @@ -180456,10 +180464,11 @@ | ||
| 180456 | 180464 | if( b==2 ) b = sizeof(LONGDOUBLE_TYPE)>8; |
| 180457 | 180465 | if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; |
| 180458 | 180466 | rc = sqlite3Config.bUseLongDouble!=0; |
| 180459 | 180467 | break; |
| 180460 | 180468 | } |
| 180469 | +#endif | |
| 180461 | 180470 | |
| 180462 | 180471 | |
| 180463 | 180472 | #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD) |
| 180464 | 180473 | /* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue) |
| 180465 | 180474 | ** |
| @@ -201910,11 +201919,13 @@ | ||
| 201910 | 201919 | JsonNode *p; |
| 201911 | 201920 | assert( pParse->aNode!=0 || pParse->nNode>=pParse->nAlloc ); |
| 201912 | 201921 | if( pParse->nNode>=pParse->nAlloc ){ |
| 201913 | 201922 | return jsonParseAddNodeExpand(pParse, eType, n, zContent); |
| 201914 | 201923 | } |
| 201924 | + assert( pParse->aNode!=0 ); | |
| 201915 | 201925 | p = &pParse->aNode[pParse->nNode]; |
| 201926 | + assert( p!=0 ); | |
| 201916 | 201927 | p->eType = (u8)(eType & 0xff); |
| 201917 | 201928 | p->jnFlags = (u8)(eType >> 8); |
| 201918 | 201929 | VVA( p->eU = zContent ? 1 : 0 ); |
| 201919 | 201930 | p->n = n; |
| 201920 | 201931 | p->u.zJContent = zContent; |
| @@ -201930,10 +201941,12 @@ | ||
| 201930 | 201941 | static void jsonParseAddNodeArray( |
| 201931 | 201942 | JsonParse *pParse, /* Append the node to this object */ |
| 201932 | 201943 | JsonNode *aNode, /* Array of nodes to add */ |
| 201933 | 201944 | u32 nNode /* Number of elements in aNew */ |
| 201934 | 201945 | ){ |
| 201946 | + assert( aNode!=0 ); | |
| 201947 | + assert( nNode>=1 ); | |
| 201935 | 201948 | if( pParse->nNode + nNode > pParse->nAlloc ){ |
| 201936 | 201949 | u32 nNew = pParse->nNode + nNode; |
| 201937 | 201950 | JsonNode *aNew = sqlite3_realloc64(pParse->aNode, nNew*sizeof(JsonNode)); |
| 201938 | 201951 | if( aNew==0 ){ |
| 201939 | 201952 | pParse->oom = 1; |
| @@ -202827,24 +202840,29 @@ | ||
| 202827 | 202840 | u32 i, j, nKey; |
| 202828 | 202841 | const char *zKey; |
| 202829 | 202842 | JsonNode *pRoot; |
| 202830 | 202843 | if( pParse->oom ) return 0; |
| 202831 | 202844 | pRoot = &pParse->aNode[iRoot]; |
| 202832 | - while( (pRoot->jnFlags & JNODE_REPLACE)!=0 && pParse->useMod ){ | |
| 202833 | - u32 idx = (u32)(pRoot - pParse->aNode); | |
| 202834 | - i = pParse->iSubst; | |
| 202835 | - while( 1 /*exit-by-break*/ ){ | |
| 202836 | - assert( i<pParse->nNode ); | |
| 202837 | - assert( pParse->aNode[i].eType==JSON_SUBST ); | |
| 202838 | - assert( pParse->aNode[i].eU==4 ); | |
| 202839 | - assert( pParse->aNode[i].u.iPrev<i ); | |
| 202840 | - if( pParse->aNode[i].n==idx ){ | |
| 202841 | - pRoot = &pParse->aNode[i+1]; | |
| 202842 | - iRoot = i+1; | |
| 202843 | - break; | |
| 202844 | - } | |
| 202845 | - i = pParse->aNode[i].u.iPrev; | |
| 202845 | + if( pRoot->jnFlags & (JNODE_REPLACE|JNODE_REMOVE) && pParse->useMod ){ | |
| 202846 | + while( (pRoot->jnFlags & JNODE_REPLACE)!=0 ){ | |
| 202847 | + u32 idx = (u32)(pRoot - pParse->aNode); | |
| 202848 | + i = pParse->iSubst; | |
| 202849 | + while( 1 /*exit-by-break*/ ){ | |
| 202850 | + assert( i<pParse->nNode ); | |
| 202851 | + assert( pParse->aNode[i].eType==JSON_SUBST ); | |
| 202852 | + assert( pParse->aNode[i].eU==4 ); | |
| 202853 | + assert( pParse->aNode[i].u.iPrev<i ); | |
| 202854 | + if( pParse->aNode[i].n==idx ){ | |
| 202855 | + pRoot = &pParse->aNode[i+1]; | |
| 202856 | + iRoot = i+1; | |
| 202857 | + break; | |
| 202858 | + } | |
| 202859 | + i = pParse->aNode[i].u.iPrev; | |
| 202860 | + } | |
| 202861 | + } | |
| 202862 | + if( pRoot->jnFlags & JNODE_REMOVE ){ | |
| 202863 | + return 0; | |
| 202846 | 202864 | } |
| 202847 | 202865 | } |
| 202848 | 202866 | if( zPath[0]==0 ) return pRoot; |
| 202849 | 202867 | if( zPath[0]=='.' ){ |
| 202850 | 202868 | if( pRoot->eType!=JSON_OBJECT ) return 0; |
| @@ -225621,11 +225639,11 @@ | ||
| 225621 | 225639 | ** |
| 225622 | 225640 | ** xPhraseNextColumn() |
| 225623 | 225641 | ** See xPhraseFirstColumn above. |
| 225624 | 225642 | */ |
| 225625 | 225643 | struct Fts5ExtensionApi { |
| 225626 | - int iVersion; /* Currently always set to 3 */ | |
| 225644 | + int iVersion; /* Currently always set to 2 */ | |
| 225627 | 225645 | |
| 225628 | 225646 | void *(*xUserData)(Fts5Context*); |
| 225629 | 225647 | |
| 225630 | 225648 | int (*xColumnCount)(Fts5Context*); |
| 225631 | 225649 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -245297,11 +245315,11 @@ | ||
| 245297 | 245315 | int nArg, /* Number of args */ |
| 245298 | 245316 | sqlite3_value **apUnused /* Function arguments */ |
| 245299 | 245317 | ){ |
| 245300 | 245318 | assert( nArg==0 ); |
| 245301 | 245319 | UNUSED_PARAM2(nArg, apUnused); |
| 245302 | - sqlite3_result_text(pCtx, "fts5: 2023-08-01 11:03:06 aa55c83f35c2ab134e0842201e46e021079283f9c65595c86664060b3aa8d715", -1, SQLITE_TRANSIENT); | |
| 245320 | + sqlite3_result_text(pCtx, "fts5: 2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65", -1, SQLITE_TRANSIENT); | |
| 245303 | 245321 | } |
| 245304 | 245322 | |
| 245305 | 245323 | /* |
| 245306 | 245324 | ** Return true if zName is the extension on one of the shadow tables used |
| 245307 | 245325 | ** by this module. |
| 245308 | 245326 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** a0b9aecbaca9a8e784fd2bcb50f78cbdcf4. |
| 22 | */ |
| 23 | #define SQLITE_CORE 1 |
| 24 | #define SQLITE_AMALGAMATION 1 |
| 25 | #ifndef SQLITE_PRIVATE |
| 26 | # define SQLITE_PRIVATE static |
| @@ -459,11 +459,11 @@ | |
| 459 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 460 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 461 | */ |
| 462 | #define SQLITE_VERSION "3.43.0" |
| 463 | #define SQLITE_VERSION_NUMBER 3043000 |
| 464 | #define SQLITE_SOURCE_ID "2023-08-02 16:06:02 ea0b9aecbaca9a8e784fd2bcb50f78cbdcf4c5cfb45a7700bb222e4cc104c644" |
| 465 | |
| 466 | /* |
| 467 | ** CAPI3REF: Run-Time Library Version Numbers |
| 468 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 469 | ** |
| @@ -13116,11 +13116,11 @@ | |
| 13116 | ** |
| 13117 | ** xPhraseNextColumn() |
| 13118 | ** See xPhraseFirstColumn above. |
| 13119 | */ |
| 13120 | struct Fts5ExtensionApi { |
| 13121 | int iVersion; /* Currently always set to 3 */ |
| 13122 | |
| 13123 | void *(*xUserData)(Fts5Context*); |
| 13124 | |
| 13125 | int (*xColumnCount)(Fts5Context*); |
| 13126 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -44325,16 +44325,21 @@ | |
| 44325 | ** requested from the underlying operating system, a number which |
| 44326 | ** might be greater than or equal to the argument, but not less |
| 44327 | ** than the argument. |
| 44328 | */ |
| 44329 | static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ |
| 44330 | #if OS_VXWORKS || _POSIX_C_SOURCE >= 199309L |
| 44331 | struct timespec sp; |
| 44332 | |
| 44333 | sp.tv_sec = microseconds / 1000000; |
| 44334 | sp.tv_nsec = (microseconds % 1000000) * 1000; |
| 44335 | nanosleep(&sp, NULL); |
| 44336 | UNUSED_PARAMETER(NotUsed); |
| 44337 | return microseconds; |
| 44338 | #elif defined(HAVE_USLEEP) && HAVE_USLEEP |
| 44339 | if( microseconds>=1000000 ) sleep(microseconds/1000000); |
| 44340 | if( microseconds%1000000 ) usleep(microseconds%1000000); |
| @@ -94528,11 +94533,11 @@ | |
| 94528 | if( ((p5 = (pOp->p5 & OPFLAG_BYTELENARG))!=0 |
| 94529 | && (p5==OPFLAG_TYPEOFARG |
| 94530 | || (t>=12 && ((t&1)==0 || p5==OPFLAG_BYTELENARG)) |
| 94531 | ) |
| 94532 | ) |
| 94533 | || (len = sqlite3VdbeSerialTypeLen(t))==0 |
| 94534 | ){ |
| 94535 | /* Content is irrelevant for |
| 94536 | ** 1. the typeof() function, |
| 94537 | ** 2. the length(X) function if X is a blob, and |
| 94538 | ** 3. if the content length is zero. |
| @@ -177637,13 +177642,13 @@ | |
| 177637 | */ |
| 177638 | static int sqliteDefaultBusyCallback( |
| 177639 | void *ptr, /* Database connection */ |
| 177640 | int count /* Number of times table has been busy */ |
| 177641 | ){ |
| 177642 | #if SQLITE_OS_WIN || HAVE_USLEEP |
| 177643 | /* This case is for systems that have support for sleeping for fractions of |
| 177644 | ** a second. Examples: All windows systems, unix systems with usleep() */ |
| 177645 | static const u8 delays[] = |
| 177646 | { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; |
| 177647 | static const u8 totals[] = |
| 177648 | { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; |
| 177649 | # define NDELAY ArraySize(delays) |
| @@ -180132,14 +180137,16 @@ | |
| 180132 | sqlite3ShowExprList(0); |
| 180133 | sqlite3ShowIdList(0); |
| 180134 | sqlite3ShowSrcList(0); |
| 180135 | sqlite3ShowWith(0); |
| 180136 | sqlite3ShowUpsert(0); |
| 180137 | sqlite3ShowTriggerStep(0); |
| 180138 | sqlite3ShowTriggerStepList(0); |
| 180139 | sqlite3ShowTrigger(0); |
| 180140 | sqlite3ShowTriggerList(0); |
| 180141 | #ifndef SQLITE_OMIT_WINDOWFUNC |
| 180142 | sqlite3ShowWindow(0); |
| 180143 | sqlite3ShowWinFunc(0); |
| 180144 | #endif |
| 180145 | sqlite3ShowSelect(0); |
| @@ -180442,10 +180449,11 @@ | |
| 180442 | *pU64 = sqlite3LogEstToInt(rLogEst); |
| 180443 | *pI2 = sqlite3LogEst(*pU64); |
| 180444 | break; |
| 180445 | } |
| 180446 | |
| 180447 | /* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X); |
| 180448 | ** |
| 180449 | ** X<0 Make no changes to the bUseLongDouble. Just report value. |
| 180450 | ** X==0 Disable bUseLongDouble |
| 180451 | ** X==1 Enable bUseLongDouble |
| @@ -180456,10 +180464,11 @@ | |
| 180456 | if( b==2 ) b = sizeof(LONGDOUBLE_TYPE)>8; |
| 180457 | if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; |
| 180458 | rc = sqlite3Config.bUseLongDouble!=0; |
| 180459 | break; |
| 180460 | } |
| 180461 | |
| 180462 | |
| 180463 | #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD) |
| 180464 | /* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue) |
| 180465 | ** |
| @@ -201910,11 +201919,13 @@ | |
| 201910 | JsonNode *p; |
| 201911 | assert( pParse->aNode!=0 || pParse->nNode>=pParse->nAlloc ); |
| 201912 | if( pParse->nNode>=pParse->nAlloc ){ |
| 201913 | return jsonParseAddNodeExpand(pParse, eType, n, zContent); |
| 201914 | } |
| 201915 | p = &pParse->aNode[pParse->nNode]; |
| 201916 | p->eType = (u8)(eType & 0xff); |
| 201917 | p->jnFlags = (u8)(eType >> 8); |
| 201918 | VVA( p->eU = zContent ? 1 : 0 ); |
| 201919 | p->n = n; |
| 201920 | p->u.zJContent = zContent; |
| @@ -201930,10 +201941,12 @@ | |
| 201930 | static void jsonParseAddNodeArray( |
| 201931 | JsonParse *pParse, /* Append the node to this object */ |
| 201932 | JsonNode *aNode, /* Array of nodes to add */ |
| 201933 | u32 nNode /* Number of elements in aNew */ |
| 201934 | ){ |
| 201935 | if( pParse->nNode + nNode > pParse->nAlloc ){ |
| 201936 | u32 nNew = pParse->nNode + nNode; |
| 201937 | JsonNode *aNew = sqlite3_realloc64(pParse->aNode, nNew*sizeof(JsonNode)); |
| 201938 | if( aNew==0 ){ |
| 201939 | pParse->oom = 1; |
| @@ -202827,24 +202840,29 @@ | |
| 202827 | u32 i, j, nKey; |
| 202828 | const char *zKey; |
| 202829 | JsonNode *pRoot; |
| 202830 | if( pParse->oom ) return 0; |
| 202831 | pRoot = &pParse->aNode[iRoot]; |
| 202832 | while( (pRoot->jnFlags & JNODE_REPLACE)!=0 && pParse->useMod ){ |
| 202833 | u32 idx = (u32)(pRoot - pParse->aNode); |
| 202834 | i = pParse->iSubst; |
| 202835 | while( 1 /*exit-by-break*/ ){ |
| 202836 | assert( i<pParse->nNode ); |
| 202837 | assert( pParse->aNode[i].eType==JSON_SUBST ); |
| 202838 | assert( pParse->aNode[i].eU==4 ); |
| 202839 | assert( pParse->aNode[i].u.iPrev<i ); |
| 202840 | if( pParse->aNode[i].n==idx ){ |
| 202841 | pRoot = &pParse->aNode[i+1]; |
| 202842 | iRoot = i+1; |
| 202843 | break; |
| 202844 | } |
| 202845 | i = pParse->aNode[i].u.iPrev; |
| 202846 | } |
| 202847 | } |
| 202848 | if( zPath[0]==0 ) return pRoot; |
| 202849 | if( zPath[0]=='.' ){ |
| 202850 | if( pRoot->eType!=JSON_OBJECT ) return 0; |
| @@ -225621,11 +225639,11 @@ | |
| 225621 | ** |
| 225622 | ** xPhraseNextColumn() |
| 225623 | ** See xPhraseFirstColumn above. |
| 225624 | */ |
| 225625 | struct Fts5ExtensionApi { |
| 225626 | int iVersion; /* Currently always set to 3 */ |
| 225627 | |
| 225628 | void *(*xUserData)(Fts5Context*); |
| 225629 | |
| 225630 | int (*xColumnCount)(Fts5Context*); |
| 225631 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -245297,11 +245315,11 @@ | |
| 245297 | int nArg, /* Number of args */ |
| 245298 | sqlite3_value **apUnused /* Function arguments */ |
| 245299 | ){ |
| 245300 | assert( nArg==0 ); |
| 245301 | UNUSED_PARAM2(nArg, apUnused); |
| 245302 | sqlite3_result_text(pCtx, "fts5: 2023-08-01 11:03:06 aa55c83f35c2ab134e0842201e46e021079283f9c65595c86664060b3aa8d715", -1, SQLITE_TRANSIENT); |
| 245303 | } |
| 245304 | |
| 245305 | /* |
| 245306 | ** Return true if zName is the extension on one of the shadow tables used |
| 245307 | ** by this module. |
| 245308 |
| --- extsrc/sqlite3.c | |
| +++ extsrc/sqlite3.c | |
| @@ -16,11 +16,11 @@ | |
| 16 | ** if you want a wrapper to interface SQLite with your choice of programming |
| 17 | ** language. The code for the "sqlite3" command-line shell is also in a |
| 18 | ** separate file. This file contains only code for the core SQLite library. |
| 19 | ** |
| 20 | ** The content in this amalgamation comes from Fossil check-in |
| 21 | ** a7a66db13b28da0b41f03be825a59360847. |
| 22 | */ |
| 23 | #define SQLITE_CORE 1 |
| 24 | #define SQLITE_AMALGAMATION 1 |
| 25 | #ifndef SQLITE_PRIVATE |
| 26 | # define SQLITE_PRIVATE static |
| @@ -459,11 +459,11 @@ | |
| 459 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 460 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 461 | */ |
| 462 | #define SQLITE_VERSION "3.43.0" |
| 463 | #define SQLITE_VERSION_NUMBER 3043000 |
| 464 | #define SQLITE_SOURCE_ID "2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65" |
| 465 | |
| 466 | /* |
| 467 | ** CAPI3REF: Run-Time Library Version Numbers |
| 468 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 469 | ** |
| @@ -13116,11 +13116,11 @@ | |
| 13116 | ** |
| 13117 | ** xPhraseNextColumn() |
| 13118 | ** See xPhraseFirstColumn above. |
| 13119 | */ |
| 13120 | struct Fts5ExtensionApi { |
| 13121 | int iVersion; /* Currently always set to 2 */ |
| 13122 | |
| 13123 | void *(*xUserData)(Fts5Context*); |
| 13124 | |
| 13125 | int (*xColumnCount)(Fts5Context*); |
| 13126 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -44325,16 +44325,21 @@ | |
| 44325 | ** requested from the underlying operating system, a number which |
| 44326 | ** might be greater than or equal to the argument, but not less |
| 44327 | ** than the argument. |
| 44328 | */ |
| 44329 | static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ |
| 44330 | #if !defined(HAVE_NANOSLEEP) || HAVE_NANOSLEEP+0 |
| 44331 | struct timespec sp; |
| 44332 | sp.tv_sec = microseconds / 1000000; |
| 44333 | sp.tv_nsec = (microseconds % 1000000) * 1000; |
| 44334 | |
| 44335 | /* Almost all modern unix systems support nanosleep(). But if you are |
| 44336 | ** compiling for one of the rare exceptions, you can use |
| 44337 | ** -DHAVE_NANOSLEEP=0 (perhaps in conjuction with -DHAVE_USLEEP if |
| 44338 | ** usleep() is available) in order to bypass the use of nanosleep() */ |
| 44339 | nanosleep(&sp, NULL); |
| 44340 | |
| 44341 | UNUSED_PARAMETER(NotUsed); |
| 44342 | return microseconds; |
| 44343 | #elif defined(HAVE_USLEEP) && HAVE_USLEEP |
| 44344 | if( microseconds>=1000000 ) sleep(microseconds/1000000); |
| 44345 | if( microseconds%1000000 ) usleep(microseconds%1000000); |
| @@ -94528,11 +94533,11 @@ | |
| 94533 | if( ((p5 = (pOp->p5 & OPFLAG_BYTELENARG))!=0 |
| 94534 | && (p5==OPFLAG_TYPEOFARG |
| 94535 | || (t>=12 && ((t&1)==0 || p5==OPFLAG_BYTELENARG)) |
| 94536 | ) |
| 94537 | ) |
| 94538 | || sqlite3VdbeSerialTypeLen(t)==0 |
| 94539 | ){ |
| 94540 | /* Content is irrelevant for |
| 94541 | ** 1. the typeof() function, |
| 94542 | ** 2. the length(X) function if X is a blob, and |
| 94543 | ** 3. if the content length is zero. |
| @@ -177637,13 +177642,13 @@ | |
| 177642 | */ |
| 177643 | static int sqliteDefaultBusyCallback( |
| 177644 | void *ptr, /* Database connection */ |
| 177645 | int count /* Number of times table has been busy */ |
| 177646 | ){ |
| 177647 | #if SQLITE_OS_WIN || !defined(HAVE_NANOSLEEP) || HAVE_NANOSLEEP |
| 177648 | /* This case is for systems that have support for sleeping for fractions of |
| 177649 | ** a second. Examples: All windows systems, unix systems with nanosleep() */ |
| 177650 | static const u8 delays[] = |
| 177651 | { 1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100 }; |
| 177652 | static const u8 totals[] = |
| 177653 | { 0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228 }; |
| 177654 | # define NDELAY ArraySize(delays) |
| @@ -180132,14 +180137,16 @@ | |
| 180137 | sqlite3ShowExprList(0); |
| 180138 | sqlite3ShowIdList(0); |
| 180139 | sqlite3ShowSrcList(0); |
| 180140 | sqlite3ShowWith(0); |
| 180141 | sqlite3ShowUpsert(0); |
| 180142 | #ifndef SQLITE_OMIT_TRIGGER |
| 180143 | sqlite3ShowTriggerStep(0); |
| 180144 | sqlite3ShowTriggerStepList(0); |
| 180145 | sqlite3ShowTrigger(0); |
| 180146 | sqlite3ShowTriggerList(0); |
| 180147 | #endif |
| 180148 | #ifndef SQLITE_OMIT_WINDOWFUNC |
| 180149 | sqlite3ShowWindow(0); |
| 180150 | sqlite3ShowWinFunc(0); |
| 180151 | #endif |
| 180152 | sqlite3ShowSelect(0); |
| @@ -180442,10 +180449,11 @@ | |
| 180449 | *pU64 = sqlite3LogEstToInt(rLogEst); |
| 180450 | *pI2 = sqlite3LogEst(*pU64); |
| 180451 | break; |
| 180452 | } |
| 180453 | |
| 180454 | #if !defined(SQLITE_OMIT_WSD) |
| 180455 | /* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X); |
| 180456 | ** |
| 180457 | ** X<0 Make no changes to the bUseLongDouble. Just report value. |
| 180458 | ** X==0 Disable bUseLongDouble |
| 180459 | ** X==1 Enable bUseLongDouble |
| @@ -180456,10 +180464,11 @@ | |
| 180464 | if( b==2 ) b = sizeof(LONGDOUBLE_TYPE)>8; |
| 180465 | if( b>=0 ) sqlite3Config.bUseLongDouble = b>0; |
| 180466 | rc = sqlite3Config.bUseLongDouble!=0; |
| 180467 | break; |
| 180468 | } |
| 180469 | #endif |
| 180470 | |
| 180471 | |
| 180472 | #if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD) |
| 180473 | /* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue) |
| 180474 | ** |
| @@ -201910,11 +201919,13 @@ | |
| 201919 | JsonNode *p; |
| 201920 | assert( pParse->aNode!=0 || pParse->nNode>=pParse->nAlloc ); |
| 201921 | if( pParse->nNode>=pParse->nAlloc ){ |
| 201922 | return jsonParseAddNodeExpand(pParse, eType, n, zContent); |
| 201923 | } |
| 201924 | assert( pParse->aNode!=0 ); |
| 201925 | p = &pParse->aNode[pParse->nNode]; |
| 201926 | assert( p!=0 ); |
| 201927 | p->eType = (u8)(eType & 0xff); |
| 201928 | p->jnFlags = (u8)(eType >> 8); |
| 201929 | VVA( p->eU = zContent ? 1 : 0 ); |
| 201930 | p->n = n; |
| 201931 | p->u.zJContent = zContent; |
| @@ -201930,10 +201941,12 @@ | |
| 201941 | static void jsonParseAddNodeArray( |
| 201942 | JsonParse *pParse, /* Append the node to this object */ |
| 201943 | JsonNode *aNode, /* Array of nodes to add */ |
| 201944 | u32 nNode /* Number of elements in aNew */ |
| 201945 | ){ |
| 201946 | assert( aNode!=0 ); |
| 201947 | assert( nNode>=1 ); |
| 201948 | if( pParse->nNode + nNode > pParse->nAlloc ){ |
| 201949 | u32 nNew = pParse->nNode + nNode; |
| 201950 | JsonNode *aNew = sqlite3_realloc64(pParse->aNode, nNew*sizeof(JsonNode)); |
| 201951 | if( aNew==0 ){ |
| 201952 | pParse->oom = 1; |
| @@ -202827,24 +202840,29 @@ | |
| 202840 | u32 i, j, nKey; |
| 202841 | const char *zKey; |
| 202842 | JsonNode *pRoot; |
| 202843 | if( pParse->oom ) return 0; |
| 202844 | pRoot = &pParse->aNode[iRoot]; |
| 202845 | if( pRoot->jnFlags & (JNODE_REPLACE|JNODE_REMOVE) && pParse->useMod ){ |
| 202846 | while( (pRoot->jnFlags & JNODE_REPLACE)!=0 ){ |
| 202847 | u32 idx = (u32)(pRoot - pParse->aNode); |
| 202848 | i = pParse->iSubst; |
| 202849 | while( 1 /*exit-by-break*/ ){ |
| 202850 | assert( i<pParse->nNode ); |
| 202851 | assert( pParse->aNode[i].eType==JSON_SUBST ); |
| 202852 | assert( pParse->aNode[i].eU==4 ); |
| 202853 | assert( pParse->aNode[i].u.iPrev<i ); |
| 202854 | if( pParse->aNode[i].n==idx ){ |
| 202855 | pRoot = &pParse->aNode[i+1]; |
| 202856 | iRoot = i+1; |
| 202857 | break; |
| 202858 | } |
| 202859 | i = pParse->aNode[i].u.iPrev; |
| 202860 | } |
| 202861 | } |
| 202862 | if( pRoot->jnFlags & JNODE_REMOVE ){ |
| 202863 | return 0; |
| 202864 | } |
| 202865 | } |
| 202866 | if( zPath[0]==0 ) return pRoot; |
| 202867 | if( zPath[0]=='.' ){ |
| 202868 | if( pRoot->eType!=JSON_OBJECT ) return 0; |
| @@ -225621,11 +225639,11 @@ | |
| 225639 | ** |
| 225640 | ** xPhraseNextColumn() |
| 225641 | ** See xPhraseFirstColumn above. |
| 225642 | */ |
| 225643 | struct Fts5ExtensionApi { |
| 225644 | int iVersion; /* Currently always set to 2 */ |
| 225645 | |
| 225646 | void *(*xUserData)(Fts5Context*); |
| 225647 | |
| 225648 | int (*xColumnCount)(Fts5Context*); |
| 225649 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| @@ -245297,11 +245315,11 @@ | |
| 245315 | int nArg, /* Number of args */ |
| 245316 | sqlite3_value **apUnused /* Function arguments */ |
| 245317 | ){ |
| 245318 | assert( nArg==0 ); |
| 245319 | UNUSED_PARAM2(nArg, apUnused); |
| 245320 | sqlite3_result_text(pCtx, "fts5: 2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65", -1, SQLITE_TRANSIENT); |
| 245321 | } |
| 245322 | |
| 245323 | /* |
| 245324 | ** Return true if zName is the extension on one of the shadow tables used |
| 245325 | ** by this module. |
| 245326 |
+2
-2
| --- extsrc/sqlite3.h | ||
| +++ extsrc/sqlite3.h | ||
| @@ -146,11 +146,11 @@ | ||
| 146 | 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 147 | 147 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 148 | 148 | */ |
| 149 | 149 | #define SQLITE_VERSION "3.43.0" |
| 150 | 150 | #define SQLITE_VERSION_NUMBER 3043000 |
| 151 | -#define SQLITE_SOURCE_ID "2023-08-02 16:06:02 ea0b9aecbaca9a8e784fd2bcb50f78cbdcf4c5cfb45a7700bb222e4cc104c644" | |
| 151 | +#define SQLITE_SOURCE_ID "2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65" | |
| 152 | 152 | |
| 153 | 153 | /* |
| 154 | 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | 156 | ** |
| @@ -12803,11 +12803,11 @@ | ||
| 12803 | 12803 | ** |
| 12804 | 12804 | ** xPhraseNextColumn() |
| 12805 | 12805 | ** See xPhraseFirstColumn above. |
| 12806 | 12806 | */ |
| 12807 | 12807 | struct Fts5ExtensionApi { |
| 12808 | - int iVersion; /* Currently always set to 3 */ | |
| 12808 | + int iVersion; /* Currently always set to 2 */ | |
| 12809 | 12809 | |
| 12810 | 12810 | void *(*xUserData)(Fts5Context*); |
| 12811 | 12811 | |
| 12812 | 12812 | int (*xColumnCount)(Fts5Context*); |
| 12813 | 12813 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 12814 | 12814 |
| --- 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.43.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3043000 |
| 151 | #define SQLITE_SOURCE_ID "2023-08-02 16:06:02 ea0b9aecbaca9a8e784fd2bcb50f78cbdcf4c5cfb45a7700bb222e4cc104c644" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| @@ -12803,11 +12803,11 @@ | |
| 12803 | ** |
| 12804 | ** xPhraseNextColumn() |
| 12805 | ** See xPhraseFirstColumn above. |
| 12806 | */ |
| 12807 | struct Fts5ExtensionApi { |
| 12808 | int iVersion; /* Currently always set to 3 */ |
| 12809 | |
| 12810 | void *(*xUserData)(Fts5Context*); |
| 12811 | |
| 12812 | int (*xColumnCount)(Fts5Context*); |
| 12813 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 12814 |
| --- 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.43.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3043000 |
| 151 | #define SQLITE_SOURCE_ID "2023-08-04 13:19:11 ba7a66db13b28da0b41f03be825a593608474a5ebda89e12d58d89db709b8f65" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| @@ -12803,11 +12803,11 @@ | |
| 12803 | ** |
| 12804 | ** xPhraseNextColumn() |
| 12805 | ** See xPhraseFirstColumn above. |
| 12806 | */ |
| 12807 | struct Fts5ExtensionApi { |
| 12808 | int iVersion; /* Currently always set to 2 */ |
| 12809 | |
| 12810 | void *(*xUserData)(Fts5Context*); |
| 12811 | |
| 12812 | int (*xColumnCount)(Fts5Context*); |
| 12813 | int (*xRowCount)(Fts5Context*, sqlite3_int64 *pnRow); |
| 12814 |