Fossil SCM
Update the built-in SQLite to the latest 3.48.0 beta, for testing.
Commit
3cb092c0e2f0ff266a7dcf0c35b19c5f665180d0e9cdd13da0fd1538c97232bf
Parent
6b8b56ca1905c55…
2 files changed
+23
-17
+1
-1
+23
-17
| --- 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 | -** e6c30ee52c5cdc193804cec63374d558b45e with changes in files: | |
| 21 | +** 2b17bc49655c577029919c2d409de994b0d2 with changes in files: | |
| 22 | 22 | ** |
| 23 | 23 | ** |
| 24 | 24 | */ |
| 25 | 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | ||
| 465 | 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | 467 | */ |
| 468 | 468 | #define SQLITE_VERSION "3.48.0" |
| 469 | 469 | #define SQLITE_VERSION_NUMBER 3048000 |
| 470 | -#define SQLITE_SOURCE_ID "2024-12-19 19:02:09 e6c30ee52c5cdc193804cec63374d558b45e4d67fc6bde58771ca78485ca0acf" | |
| 470 | +#define SQLITE_SOURCE_ID "2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552" | |
| 471 | 471 | |
| 472 | 472 | /* |
| 473 | 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | 475 | ** |
| @@ -87155,10 +87155,11 @@ | ||
| 87155 | 87155 | ** |
| 87156 | 87156 | ** All other fields of Mem can safely remain uninitialized for now. They |
| 87157 | 87157 | ** will be initialized before use. |
| 87158 | 87158 | */ |
| 87159 | 87159 | static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){ |
| 87160 | + assert( db!=0 ); | |
| 87160 | 87161 | if( N>0 ){ |
| 87161 | 87162 | do{ |
| 87162 | 87163 | p->flags = flags; |
| 87163 | 87164 | p->db = db; |
| 87164 | 87165 | p->szMalloc = 0; |
| @@ -87180,10 +87181,11 @@ | ||
| 87180 | 87181 | */ |
| 87181 | 87182 | static void releaseMemArray(Mem *p, int N){ |
| 87182 | 87183 | if( p && N ){ |
| 87183 | 87184 | Mem *pEnd = &p[N]; |
| 87184 | 87185 | sqlite3 *db = p->db; |
| 87186 | + assert( db!=0 ); | |
| 87185 | 87187 | if( db->pnBytesFreed ){ |
| 87186 | 87188 | do{ |
| 87187 | 87189 | if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
| 87188 | 87190 | }while( (++p)<pEnd ); |
| 87189 | 87191 | return; |
| @@ -87660,10 +87662,11 @@ | ||
| 87660 | 87662 | assert( p!=0 ); |
| 87661 | 87663 | assert( p->nOp>0 ); |
| 87662 | 87664 | assert( pParse!=0 ); |
| 87663 | 87665 | assert( p->eVdbeState==VDBE_INIT_STATE ); |
| 87664 | 87666 | assert( pParse==p->pParse ); |
| 87667 | + assert( pParse->db==p->db ); | |
| 87665 | 87668 | p->pVList = pParse->pVList; |
| 87666 | 87669 | pParse->pVList = 0; |
| 87667 | 87670 | db = p->db; |
| 87668 | 87671 | assert( db->mallocFailed==0 ); |
| 87669 | 87672 | nVar = pParse->nVar; |
| @@ -129731,11 +129734,10 @@ | ||
| 129731 | 129734 | const unsigned char *z; |
| 129732 | 129735 | const unsigned char *z2; |
| 129733 | 129736 | int len; |
| 129734 | 129737 | int p0type; |
| 129735 | 129738 | i64 p1, p2; |
| 129736 | - int negP2 = 0; | |
| 129737 | 129739 | |
| 129738 | 129740 | assert( argc==3 || argc==2 ); |
| 129739 | 129741 | if( sqlite3_value_type(argv[1])==SQLITE_NULL |
| 129740 | 129742 | || (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
| 129741 | 129743 | ){ |
| @@ -129766,35 +129768,35 @@ | ||
| 129766 | 129768 | ** old buggy behavior. */ |
| 129767 | 129769 | if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */ |
| 129768 | 129770 | #endif |
| 129769 | 129771 | if( argc==3 ){ |
| 129770 | 129772 | p2 = sqlite3_value_int64(argv[2]); |
| 129771 | - if( p2<0 ){ | |
| 129772 | - p2 = -p2; | |
| 129773 | - negP2 = 1; | |
| 129774 | - } | |
| 129775 | 129773 | }else{ |
| 129776 | 129774 | p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH]; |
| 129777 | 129775 | } |
| 129778 | 129776 | if( p1<0 ){ |
| 129779 | 129777 | p1 += len; |
| 129780 | 129778 | if( p1<0 ){ |
| 129781 | - p2 += p1; | |
| 129782 | - if( p2<0 ) p2 = 0; | |
| 129779 | + if( p2<0 ){ | |
| 129780 | + p2 = 0; | |
| 129781 | + }else{ | |
| 129782 | + p2 += p1; | |
| 129783 | + } | |
| 129783 | 129784 | p1 = 0; |
| 129784 | 129785 | } |
| 129785 | 129786 | }else if( p1>0 ){ |
| 129786 | 129787 | p1--; |
| 129787 | 129788 | }else if( p2>0 ){ |
| 129788 | 129789 | p2--; |
| 129789 | 129790 | } |
| 129790 | - if( negP2 ){ | |
| 129791 | + if( p2<0 ){ | |
| 129792 | + if( p2<-p1 ){ | |
| 129793 | + p2 = p1; | |
| 129794 | + }else{ | |
| 129795 | + p2 = -p2; | |
| 129796 | + } | |
| 129791 | 129797 | p1 -= p2; |
| 129792 | - if( p1<0 ){ | |
| 129793 | - p2 += p1; | |
| 129794 | - p1 = 0; | |
| 129795 | - } | |
| 129796 | 129798 | } |
| 129797 | 129799 | assert( p1>=0 && p2>=0 ); |
| 129798 | 129800 | if( p0type!=SQLITE_BLOB ){ |
| 129799 | 129801 | while( *z && p1 ){ |
| 129800 | 129802 | SQLITE_SKIP_UTF8(z); |
| @@ -129840,11 +129842,11 @@ | ||
| 129840 | 129842 | if( r<-4503599627370496.0 || r>+4503599627370496.0 ){ |
| 129841 | 129843 | /* The value has no fractional part so there is nothing to round */ |
| 129842 | 129844 | }else if( n==0 ){ |
| 129843 | 129845 | r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5))); |
| 129844 | 129846 | }else{ |
| 129845 | - zBuf = sqlite3_mprintf("%!.*f",n,r); | |
| 129847 | + zBuf = sqlite3_mprintf("%!.*f",(int)n,r); | |
| 129846 | 129848 | if( zBuf==0 ){ |
| 129847 | 129849 | sqlite3_result_error_nomem(context); |
| 129848 | 129850 | return; |
| 129849 | 129851 | } |
| 129850 | 129852 | sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8); |
| @@ -215536,12 +215538,12 @@ | ||
| 215536 | 215538 | #endif |
| 215537 | 215539 | } |
| 215538 | 215540 | sqlite3_str_append(pOut, "}", 1); |
| 215539 | 215541 | } |
| 215540 | 215542 | errCode = sqlite3_str_errcode(pOut); |
| 215541 | - sqlite3_result_text(ctx, sqlite3_str_finish(pOut), -1, sqlite3_free); | |
| 215542 | 215543 | sqlite3_result_error_code(ctx, errCode); |
| 215544 | + sqlite3_result_text(ctx, sqlite3_str_finish(pOut), -1, sqlite3_free); | |
| 215543 | 215545 | } |
| 215544 | 215546 | |
| 215545 | 215547 | /* This routine implements an SQL function that returns the "depth" parameter |
| 215546 | 215548 | ** from the front of a blob that is an r-tree node. For example: |
| 215547 | 215549 | ** |
| @@ -249081,17 +249083,19 @@ | ||
| 249081 | 249083 | fts5BufferFree(&s.aBuf[iFree]); |
| 249082 | 249084 | } |
| 249083 | 249085 | } |
| 249084 | 249086 | |
| 249085 | 249087 | pData = fts5IdxMalloc(p, sizeof(*pData)+s.doclist.n+FTS5_DATA_ZERO_PADDING); |
| 249088 | + assert( pData!=0 || p->rc!=SQLITE_OK ); | |
| 249086 | 249089 | if( pData ){ |
| 249087 | 249090 | pData->p = (u8*)&pData[1]; |
| 249088 | 249091 | pData->nn = pData->szLeaf = s.doclist.n; |
| 249089 | 249092 | if( s.doclist.n ) memcpy(pData->p, s.doclist.p, s.doclist.n); |
| 249090 | 249093 | fts5MultiIterNew2(p, pData, bDesc, ppIter); |
| 249091 | 249094 | } |
| 249092 | 249095 | |
| 249096 | + assert( (*ppIter)!=0 || p->rc!=SQLITE_OK ); | |
| 249093 | 249097 | if( p->rc==SQLITE_OK && s.pTokendata ){ |
| 249094 | 249098 | fts5TokendataIterSortMap(p, s2.pT); |
| 249095 | 249099 | (*ppIter)->pTokenDataIter = s2.pT; |
| 249096 | 249100 | s2.pT = 0; |
| 249097 | 249101 | } |
| @@ -249719,10 +249723,11 @@ | ||
| 249719 | 249723 | |
| 249720 | 249724 | if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ |
| 249721 | 249725 | int iIdx = 0; /* Index to search */ |
| 249722 | 249726 | int iPrefixIdx = 0; /* +1 prefix index */ |
| 249723 | 249727 | int bTokendata = pConfig->bTokendata; |
| 249728 | + assert( buf.p!=0 ); | |
| 249724 | 249729 | if( nToken>0 ) memcpy(&buf.p[1], pToken, nToken); |
| 249725 | 249730 | |
| 249726 | 249731 | /* The NOTOKENDATA flag is set when each token in a tokendata=1 table |
| 249727 | 249732 | ** should be treated individually, instead of merging all those with |
| 249728 | 249733 | ** a common prefix into a single entry. This is used, for example, by |
| @@ -249880,10 +249885,11 @@ | ||
| 249880 | 249885 | TokendataSetupCtx ctx; |
| 249881 | 249886 | |
| 249882 | 249887 | memset(&ctx, 0, sizeof(ctx)); |
| 249883 | 249888 | |
| 249884 | 249889 | fts5BufferGrow(&p->rc, &token, nToken+1); |
| 249890 | + assert( token.p!=0 || p->rc!=SQLITE_OK ); | |
| 249885 | 249891 | ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*ctx.pT)); |
| 249886 | 249892 | |
| 249887 | 249893 | if( p->rc==SQLITE_OK ){ |
| 249888 | 249894 | |
| 249889 | 249895 | /* Fill in the token prefix to search for */ |
| @@ -255432,11 +255438,11 @@ | ||
| 255432 | 255438 | int nArg, /* Number of args */ |
| 255433 | 255439 | sqlite3_value **apUnused /* Function arguments */ |
| 255434 | 255440 | ){ |
| 255435 | 255441 | assert( nArg==0 ); |
| 255436 | 255442 | UNUSED_PARAM2(nArg, apUnused); |
| 255437 | - sqlite3_result_text(pCtx, "fts5: 2024-12-19 14:20:47 5b96dcf5f6bf41dcb89ced64efd4585e36dce718c428c2324d94e4942905c3bb", -1, SQLITE_TRANSIENT); | |
| 255443 | + sqlite3_result_text(pCtx, "fts5: 2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552", -1, SQLITE_TRANSIENT); | |
| 255438 | 255444 | } |
| 255439 | 255445 | |
| 255440 | 255446 | /* |
| 255441 | 255447 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 255442 | 255448 | ** |
| 255443 | 255449 |
| --- 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 | ** e6c30ee52c5cdc193804cec63374d558b45e with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.48.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3048000 |
| 470 | #define SQLITE_SOURCE_ID "2024-12-19 19:02:09 e6c30ee52c5cdc193804cec63374d558b45e4d67fc6bde58771ca78485ca0acf" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -87155,10 +87155,11 @@ | |
| 87155 | ** |
| 87156 | ** All other fields of Mem can safely remain uninitialized for now. They |
| 87157 | ** will be initialized before use. |
| 87158 | */ |
| 87159 | static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){ |
| 87160 | if( N>0 ){ |
| 87161 | do{ |
| 87162 | p->flags = flags; |
| 87163 | p->db = db; |
| 87164 | p->szMalloc = 0; |
| @@ -87180,10 +87181,11 @@ | |
| 87180 | */ |
| 87181 | static void releaseMemArray(Mem *p, int N){ |
| 87182 | if( p && N ){ |
| 87183 | Mem *pEnd = &p[N]; |
| 87184 | sqlite3 *db = p->db; |
| 87185 | if( db->pnBytesFreed ){ |
| 87186 | do{ |
| 87187 | if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
| 87188 | }while( (++p)<pEnd ); |
| 87189 | return; |
| @@ -87660,10 +87662,11 @@ | |
| 87660 | assert( p!=0 ); |
| 87661 | assert( p->nOp>0 ); |
| 87662 | assert( pParse!=0 ); |
| 87663 | assert( p->eVdbeState==VDBE_INIT_STATE ); |
| 87664 | assert( pParse==p->pParse ); |
| 87665 | p->pVList = pParse->pVList; |
| 87666 | pParse->pVList = 0; |
| 87667 | db = p->db; |
| 87668 | assert( db->mallocFailed==0 ); |
| 87669 | nVar = pParse->nVar; |
| @@ -129731,11 +129734,10 @@ | |
| 129731 | const unsigned char *z; |
| 129732 | const unsigned char *z2; |
| 129733 | int len; |
| 129734 | int p0type; |
| 129735 | i64 p1, p2; |
| 129736 | int negP2 = 0; |
| 129737 | |
| 129738 | assert( argc==3 || argc==2 ); |
| 129739 | if( sqlite3_value_type(argv[1])==SQLITE_NULL |
| 129740 | || (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
| 129741 | ){ |
| @@ -129766,35 +129768,35 @@ | |
| 129766 | ** old buggy behavior. */ |
| 129767 | if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */ |
| 129768 | #endif |
| 129769 | if( argc==3 ){ |
| 129770 | p2 = sqlite3_value_int64(argv[2]); |
| 129771 | if( p2<0 ){ |
| 129772 | p2 = -p2; |
| 129773 | negP2 = 1; |
| 129774 | } |
| 129775 | }else{ |
| 129776 | p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH]; |
| 129777 | } |
| 129778 | if( p1<0 ){ |
| 129779 | p1 += len; |
| 129780 | if( p1<0 ){ |
| 129781 | p2 += p1; |
| 129782 | if( p2<0 ) p2 = 0; |
| 129783 | p1 = 0; |
| 129784 | } |
| 129785 | }else if( p1>0 ){ |
| 129786 | p1--; |
| 129787 | }else if( p2>0 ){ |
| 129788 | p2--; |
| 129789 | } |
| 129790 | if( negP2 ){ |
| 129791 | p1 -= p2; |
| 129792 | if( p1<0 ){ |
| 129793 | p2 += p1; |
| 129794 | p1 = 0; |
| 129795 | } |
| 129796 | } |
| 129797 | assert( p1>=0 && p2>=0 ); |
| 129798 | if( p0type!=SQLITE_BLOB ){ |
| 129799 | while( *z && p1 ){ |
| 129800 | SQLITE_SKIP_UTF8(z); |
| @@ -129840,11 +129842,11 @@ | |
| 129840 | if( r<-4503599627370496.0 || r>+4503599627370496.0 ){ |
| 129841 | /* The value has no fractional part so there is nothing to round */ |
| 129842 | }else if( n==0 ){ |
| 129843 | r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5))); |
| 129844 | }else{ |
| 129845 | zBuf = sqlite3_mprintf("%!.*f",n,r); |
| 129846 | if( zBuf==0 ){ |
| 129847 | sqlite3_result_error_nomem(context); |
| 129848 | return; |
| 129849 | } |
| 129850 | sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8); |
| @@ -215536,12 +215538,12 @@ | |
| 215536 | #endif |
| 215537 | } |
| 215538 | sqlite3_str_append(pOut, "}", 1); |
| 215539 | } |
| 215540 | errCode = sqlite3_str_errcode(pOut); |
| 215541 | sqlite3_result_text(ctx, sqlite3_str_finish(pOut), -1, sqlite3_free); |
| 215542 | sqlite3_result_error_code(ctx, errCode); |
| 215543 | } |
| 215544 | |
| 215545 | /* This routine implements an SQL function that returns the "depth" parameter |
| 215546 | ** from the front of a blob that is an r-tree node. For example: |
| 215547 | ** |
| @@ -249081,17 +249083,19 @@ | |
| 249081 | fts5BufferFree(&s.aBuf[iFree]); |
| 249082 | } |
| 249083 | } |
| 249084 | |
| 249085 | pData = fts5IdxMalloc(p, sizeof(*pData)+s.doclist.n+FTS5_DATA_ZERO_PADDING); |
| 249086 | if( pData ){ |
| 249087 | pData->p = (u8*)&pData[1]; |
| 249088 | pData->nn = pData->szLeaf = s.doclist.n; |
| 249089 | if( s.doclist.n ) memcpy(pData->p, s.doclist.p, s.doclist.n); |
| 249090 | fts5MultiIterNew2(p, pData, bDesc, ppIter); |
| 249091 | } |
| 249092 | |
| 249093 | if( p->rc==SQLITE_OK && s.pTokendata ){ |
| 249094 | fts5TokendataIterSortMap(p, s2.pT); |
| 249095 | (*ppIter)->pTokenDataIter = s2.pT; |
| 249096 | s2.pT = 0; |
| 249097 | } |
| @@ -249719,10 +249723,11 @@ | |
| 249719 | |
| 249720 | if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ |
| 249721 | int iIdx = 0; /* Index to search */ |
| 249722 | int iPrefixIdx = 0; /* +1 prefix index */ |
| 249723 | int bTokendata = pConfig->bTokendata; |
| 249724 | if( nToken>0 ) memcpy(&buf.p[1], pToken, nToken); |
| 249725 | |
| 249726 | /* The NOTOKENDATA flag is set when each token in a tokendata=1 table |
| 249727 | ** should be treated individually, instead of merging all those with |
| 249728 | ** a common prefix into a single entry. This is used, for example, by |
| @@ -249880,10 +249885,11 @@ | |
| 249880 | TokendataSetupCtx ctx; |
| 249881 | |
| 249882 | memset(&ctx, 0, sizeof(ctx)); |
| 249883 | |
| 249884 | fts5BufferGrow(&p->rc, &token, nToken+1); |
| 249885 | ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*ctx.pT)); |
| 249886 | |
| 249887 | if( p->rc==SQLITE_OK ){ |
| 249888 | |
| 249889 | /* Fill in the token prefix to search for */ |
| @@ -255432,11 +255438,11 @@ | |
| 255432 | int nArg, /* Number of args */ |
| 255433 | sqlite3_value **apUnused /* Function arguments */ |
| 255434 | ){ |
| 255435 | assert( nArg==0 ); |
| 255436 | UNUSED_PARAM2(nArg, apUnused); |
| 255437 | sqlite3_result_text(pCtx, "fts5: 2024-12-19 14:20:47 5b96dcf5f6bf41dcb89ced64efd4585e36dce718c428c2324d94e4942905c3bb", -1, SQLITE_TRANSIENT); |
| 255438 | } |
| 255439 | |
| 255440 | /* |
| 255441 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 255442 | ** |
| 255443 |
| --- 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 | ** 2b17bc49655c577029919c2d409de994b0d2 with changes in files: |
| 22 | ** |
| 23 | ** |
| 24 | */ |
| 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | #define SQLITE_CORE 1 |
| @@ -465,11 +465,11 @@ | |
| 465 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 466 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 467 | */ |
| 468 | #define SQLITE_VERSION "3.48.0" |
| 469 | #define SQLITE_VERSION_NUMBER 3048000 |
| 470 | #define SQLITE_SOURCE_ID "2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552" |
| 471 | |
| 472 | /* |
| 473 | ** CAPI3REF: Run-Time Library Version Numbers |
| 474 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 475 | ** |
| @@ -87155,10 +87155,11 @@ | |
| 87155 | ** |
| 87156 | ** All other fields of Mem can safely remain uninitialized for now. They |
| 87157 | ** will be initialized before use. |
| 87158 | */ |
| 87159 | static void initMemArray(Mem *p, int N, sqlite3 *db, u16 flags){ |
| 87160 | assert( db!=0 ); |
| 87161 | if( N>0 ){ |
| 87162 | do{ |
| 87163 | p->flags = flags; |
| 87164 | p->db = db; |
| 87165 | p->szMalloc = 0; |
| @@ -87180,10 +87181,11 @@ | |
| 87181 | */ |
| 87182 | static void releaseMemArray(Mem *p, int N){ |
| 87183 | if( p && N ){ |
| 87184 | Mem *pEnd = &p[N]; |
| 87185 | sqlite3 *db = p->db; |
| 87186 | assert( db!=0 ); |
| 87187 | if( db->pnBytesFreed ){ |
| 87188 | do{ |
| 87189 | if( p->szMalloc ) sqlite3DbFree(db, p->zMalloc); |
| 87190 | }while( (++p)<pEnd ); |
| 87191 | return; |
| @@ -87660,10 +87662,11 @@ | |
| 87662 | assert( p!=0 ); |
| 87663 | assert( p->nOp>0 ); |
| 87664 | assert( pParse!=0 ); |
| 87665 | assert( p->eVdbeState==VDBE_INIT_STATE ); |
| 87666 | assert( pParse==p->pParse ); |
| 87667 | assert( pParse->db==p->db ); |
| 87668 | p->pVList = pParse->pVList; |
| 87669 | pParse->pVList = 0; |
| 87670 | db = p->db; |
| 87671 | assert( db->mallocFailed==0 ); |
| 87672 | nVar = pParse->nVar; |
| @@ -129731,11 +129734,10 @@ | |
| 129734 | const unsigned char *z; |
| 129735 | const unsigned char *z2; |
| 129736 | int len; |
| 129737 | int p0type; |
| 129738 | i64 p1, p2; |
| 129739 | |
| 129740 | assert( argc==3 || argc==2 ); |
| 129741 | if( sqlite3_value_type(argv[1])==SQLITE_NULL |
| 129742 | || (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) |
| 129743 | ){ |
| @@ -129766,35 +129768,35 @@ | |
| 129768 | ** old buggy behavior. */ |
| 129769 | if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */ |
| 129770 | #endif |
| 129771 | if( argc==3 ){ |
| 129772 | p2 = sqlite3_value_int64(argv[2]); |
| 129773 | }else{ |
| 129774 | p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH]; |
| 129775 | } |
| 129776 | if( p1<0 ){ |
| 129777 | p1 += len; |
| 129778 | if( p1<0 ){ |
| 129779 | if( p2<0 ){ |
| 129780 | p2 = 0; |
| 129781 | }else{ |
| 129782 | p2 += p1; |
| 129783 | } |
| 129784 | p1 = 0; |
| 129785 | } |
| 129786 | }else if( p1>0 ){ |
| 129787 | p1--; |
| 129788 | }else if( p2>0 ){ |
| 129789 | p2--; |
| 129790 | } |
| 129791 | if( p2<0 ){ |
| 129792 | if( p2<-p1 ){ |
| 129793 | p2 = p1; |
| 129794 | }else{ |
| 129795 | p2 = -p2; |
| 129796 | } |
| 129797 | p1 -= p2; |
| 129798 | } |
| 129799 | assert( p1>=0 && p2>=0 ); |
| 129800 | if( p0type!=SQLITE_BLOB ){ |
| 129801 | while( *z && p1 ){ |
| 129802 | SQLITE_SKIP_UTF8(z); |
| @@ -129840,11 +129842,11 @@ | |
| 129842 | if( r<-4503599627370496.0 || r>+4503599627370496.0 ){ |
| 129843 | /* The value has no fractional part so there is nothing to round */ |
| 129844 | }else if( n==0 ){ |
| 129845 | r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5))); |
| 129846 | }else{ |
| 129847 | zBuf = sqlite3_mprintf("%!.*f",(int)n,r); |
| 129848 | if( zBuf==0 ){ |
| 129849 | sqlite3_result_error_nomem(context); |
| 129850 | return; |
| 129851 | } |
| 129852 | sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), SQLITE_UTF8); |
| @@ -215536,12 +215538,12 @@ | |
| 215538 | #endif |
| 215539 | } |
| 215540 | sqlite3_str_append(pOut, "}", 1); |
| 215541 | } |
| 215542 | errCode = sqlite3_str_errcode(pOut); |
| 215543 | sqlite3_result_error_code(ctx, errCode); |
| 215544 | sqlite3_result_text(ctx, sqlite3_str_finish(pOut), -1, sqlite3_free); |
| 215545 | } |
| 215546 | |
| 215547 | /* This routine implements an SQL function that returns the "depth" parameter |
| 215548 | ** from the front of a blob that is an r-tree node. For example: |
| 215549 | ** |
| @@ -249081,17 +249083,19 @@ | |
| 249083 | fts5BufferFree(&s.aBuf[iFree]); |
| 249084 | } |
| 249085 | } |
| 249086 | |
| 249087 | pData = fts5IdxMalloc(p, sizeof(*pData)+s.doclist.n+FTS5_DATA_ZERO_PADDING); |
| 249088 | assert( pData!=0 || p->rc!=SQLITE_OK ); |
| 249089 | if( pData ){ |
| 249090 | pData->p = (u8*)&pData[1]; |
| 249091 | pData->nn = pData->szLeaf = s.doclist.n; |
| 249092 | if( s.doclist.n ) memcpy(pData->p, s.doclist.p, s.doclist.n); |
| 249093 | fts5MultiIterNew2(p, pData, bDesc, ppIter); |
| 249094 | } |
| 249095 | |
| 249096 | assert( (*ppIter)!=0 || p->rc!=SQLITE_OK ); |
| 249097 | if( p->rc==SQLITE_OK && s.pTokendata ){ |
| 249098 | fts5TokendataIterSortMap(p, s2.pT); |
| 249099 | (*ppIter)->pTokenDataIter = s2.pT; |
| 249100 | s2.pT = 0; |
| 249101 | } |
| @@ -249719,10 +249723,11 @@ | |
| 249723 | |
| 249724 | if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){ |
| 249725 | int iIdx = 0; /* Index to search */ |
| 249726 | int iPrefixIdx = 0; /* +1 prefix index */ |
| 249727 | int bTokendata = pConfig->bTokendata; |
| 249728 | assert( buf.p!=0 ); |
| 249729 | if( nToken>0 ) memcpy(&buf.p[1], pToken, nToken); |
| 249730 | |
| 249731 | /* The NOTOKENDATA flag is set when each token in a tokendata=1 table |
| 249732 | ** should be treated individually, instead of merging all those with |
| 249733 | ** a common prefix into a single entry. This is used, for example, by |
| @@ -249880,10 +249885,11 @@ | |
| 249885 | TokendataSetupCtx ctx; |
| 249886 | |
| 249887 | memset(&ctx, 0, sizeof(ctx)); |
| 249888 | |
| 249889 | fts5BufferGrow(&p->rc, &token, nToken+1); |
| 249890 | assert( token.p!=0 || p->rc!=SQLITE_OK ); |
| 249891 | ctx.pT = (Fts5TokenDataIter*)sqlite3Fts5MallocZero(&p->rc, sizeof(*ctx.pT)); |
| 249892 | |
| 249893 | if( p->rc==SQLITE_OK ){ |
| 249894 | |
| 249895 | /* Fill in the token prefix to search for */ |
| @@ -255432,11 +255438,11 @@ | |
| 255438 | int nArg, /* Number of args */ |
| 255439 | sqlite3_value **apUnused /* Function arguments */ |
| 255440 | ){ |
| 255441 | assert( nArg==0 ); |
| 255442 | UNUSED_PARAM2(nArg, apUnused); |
| 255443 | sqlite3_result_text(pCtx, "fts5: 2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552", -1, SQLITE_TRANSIENT); |
| 255444 | } |
| 255445 | |
| 255446 | /* |
| 255447 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 255448 | ** |
| 255449 |
+1
-1
| --- 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.48.0" |
| 150 | 150 | #define SQLITE_VERSION_NUMBER 3048000 |
| 151 | -#define SQLITE_SOURCE_ID "2024-12-19 19:02:09 e6c30ee52c5cdc193804cec63374d558b45e4d67fc6bde58771ca78485ca0acf" | |
| 151 | +#define SQLITE_SOURCE_ID "2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552" | |
| 152 | 152 | |
| 153 | 153 | /* |
| 154 | 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | 156 | ** |
| 157 | 157 |
| --- 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.48.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3048000 |
| 151 | #define SQLITE_SOURCE_ID "2024-12-19 19:02:09 e6c30ee52c5cdc193804cec63374d558b45e4d67fc6bde58771ca78485ca0acf" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| 157 |
| --- 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.48.0" |
| 150 | #define SQLITE_VERSION_NUMBER 3048000 |
| 151 | #define SQLITE_SOURCE_ID "2024-12-30 21:23:53 2b17bc49655c577029919c2d409de994b0d252f8efb5da1ba0913f2c96bee552" |
| 152 | |
| 153 | /* |
| 154 | ** CAPI3REF: Run-Time Library Version Numbers |
| 155 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 156 | ** |
| 157 |