| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,6 @@ | |||
| 1 | 1 | /****************************************************************************** | |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite | |
| 3 | - ** version 3.53.3. By combining all the individual C code files into this | ||
| 3 | + ** version 3.53.4. By combining all the individual C code files into this | ||
| 4 | 4 | ** single large file, the entire code can be compiled as a single translation | |
| 5 | 5 | ** unit. This allows many compilers to do optimizations that would not be | |
| 6 | 6 | ** possible if the files were compiled separately. Performance improvements | |
@@ -18,7 +18,7 @@ | |||
| 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 | - ** d4c0e51e4aeb96955b99185ab9cde75c339e with changes in files: | ||
| 21 | + ** bf7c7f30031888f4e796e429ab3978879485 with changes in files: | ||
| 22 | 22 | ** | |
| 23 | 23 | ** | |
| 24 | 24 | */ | |
@@ -467,12 +467,12 @@ extern "C" { | |||
| 467 | 467 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], | |
| 468 | 468 | ** [sqlite_version()] and [sqlite_source_id()]. | |
| 469 | 469 | */ | |
| 470 | - #define SQLITE_VERSION "3.53.3" | ||
| 471 | - #define SQLITE_VERSION_NUMBER 3053003 | ||
| 472 | - #define SQLITE_SOURCE_ID "2026-06-26 20:14:12 d4c0e51e4aeb96955b99185ab9cde75c339e2c29c3f3f12428d364a10d782c62" | ||
| 470 | + #define SQLITE_VERSION "3.53.4" | ||
| 471 | + #define SQLITE_VERSION_NUMBER 3053004 | ||
| 472 | + #define SQLITE_SOURCE_ID "2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc" | ||
| 473 | 473 | #define SQLITE_SCM_BRANCH "branch-3.53" | |
| 474 | - #define SQLITE_SCM_TAGS "release version-3.53.3" | ||
| 475 | - #define SQLITE_SCM_DATETIME "2026-06-26T20:14:12.354Z" | ||
| 474 | + #define SQLITE_SCM_TAGS "release version-3.53.4" | ||
| 475 | + #define SQLITE_SCM_DATETIME "2026-07-24T19:02:57.525Z" | ||
| 476 | 476 | ||
| 477 | 477 | /* | |
| 478 | 478 | ** CAPI3REF: Run-Time Library Version Numbers | |
@@ -27591,7 +27591,7 @@ SQLITE_PRIVATE int sqlite3OsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *p | |||
| 27591 | 27591 | }else{ | |
| 27592 | 27592 | double r; | |
| 27593 | 27593 | rc = pVfs->xCurrentTime(pVfs, &r); | |
| 27594 | - *pTimeOut = (sqlite3_int64)(r*86400000.0); | ||
| 27594 | + *pTimeOut = sqlite3RealToI64(r*86400000.0); | ||
| 27595 | 27595 | } | |
| 27596 | 27596 | return rc; | |
| 27597 | 27597 | } | |
@@ -60969,7 +60969,7 @@ static int readSuperJournal(sqlite3_file *pJrnl, u64 nSuper, char **pzSuper){ | |||
| 60969 | 60969 | cksum -= zOut[u]; | |
| 60970 | 60970 | } | |
| 60971 | 60971 | } | |
| 60972 | - if( rc!=SQLITE_OK || cksum ){ | ||
| 60972 | + if( rc!=SQLITE_OK || cksum || zOut[0]==0 ){ | ||
| 60973 | 60973 | /* If the checksum doesn't add up, then one or more of the disk sectors | |
| 60974 | 60974 | ** containing the super-journal filename is corrupted. This means | |
| 60975 | 60975 | ** definitely roll back, so just return SQLITE_OK and report a (nul) | |
@@ -111437,11 +111437,20 @@ static SQLITE_NOINLINE void resolveSetExprSubtypeArg(ExprList *pList){ | |||
| 111437 | 111437 | nn = pList ? pList->nExpr : 0; | |
| 111438 | 111438 | for(ii=0; ii<nn; ii++){ | |
| 111439 | 111439 | Expr *pExpr = pList->a[ii].pExpr; | |
| 111440 | - ExprSetProperty(pExpr, EP_SubtArg); | ||
| 111441 | - if( pExpr->op==TK_SELECT ){ | ||
| 111442 | - assert( ExprUseXSelect(pExpr) ); | ||
| 111443 | - assert( pExpr->x.pSelect!=0 ); | ||
| 111444 | - resolveSetExprSubtypeArg(pExpr->x.pSelect->pEList); | ||
| 111440 | + while( 1 /*exit-by-break*/ ){ | ||
| 111441 | + ExprSetProperty(pExpr, EP_SubtArg); | ||
| 111442 | + if( pExpr->op==TK_SELECT ){ | ||
| 111443 | + assert( ExprUseXSelect(pExpr) ); | ||
| 111444 | + assert( pExpr->x.pSelect!=0 ); | ||
| 111445 | + resolveSetExprSubtypeArg(pExpr->x.pSelect->pEList); | ||
| 111446 | + break; | ||
| 111447 | + } | ||
| 111448 | + if( pExpr->op==TK_UPLUS ){ | ||
| 111449 | + pExpr = pExpr->pLeft; | ||
| 111450 | + assert( pExpr!=0 ); | ||
| 111451 | + }else{ | ||
| 111452 | + break; | ||
| 111453 | + } | ||
| 111445 | 111454 | } | |
| 111446 | 111455 | } | |
| 111447 | 111456 | } | |
@@ -176954,7 +176963,7 @@ static void nth_valueStepFunc( | |||
| 176954 | 176963 | break; | |
| 176955 | 176964 | case SQLITE_FLOAT: { | |
| 176956 | 176965 | double fVal = sqlite3_value_double(apArg[1]); | |
| 176957 | - if( ((i64)fVal)!=fVal ) goto error_out; | ||
| 176966 | + if( sqlite3RealToI64(fVal)!=fVal ) goto error_out; | ||
| 176958 | 176967 | iVal = (i64)fVal; | |
| 176959 | 176968 | break; | |
| 176960 | 176969 | } | |
@@ -210776,8 +210785,8 @@ static int fts3StringAppend( | |||
| 210776 | 210785 | ** to grow the buffer until so that it is big enough to accommodate the | |
| 210777 | 210786 | ** appended data. | |
| 210778 | 210787 | */ | |
| 210779 | - if( pStr->n+nAppend+1>=pStr->nAlloc ){ | ||
| 210780 | - sqlite3_int64 nAlloc = pStr->nAlloc+(sqlite3_int64)nAppend+100; | ||
| 210788 | + if( (i64)pStr->n+(i64)nAppend+1>=(i64)pStr->nAlloc ){ | ||
| 210789 | + i64 nAlloc = pStr->nAlloc+(i64)nAppend+100; | ||
| 210781 | 210790 | char *zNew = sqlite3_realloc64(pStr->z, nAlloc); | |
| 210782 | 210791 | if( !zNew ){ | |
| 210783 | 210792 | return SQLITE_NOMEM; | |
@@ -214981,7 +214990,8 @@ static u32 jsonTranslateBlobToText( | |||
| 214981 | 214990 | if( sz==0 ) goto malformed_jsonb; | |
| 214982 | 214991 | if( zIn[0]=='-' ){ | |
| 214983 | 214992 | jsonAppendChar(pOut, '-'); | |
| 214984 | - k++; | ||
| 214993 | + if( sz<=1 ) goto malformed_jsonb; | ||
| 214994 | + k = 1; | ||
| 214985 | 214995 | } | |
| 214986 | 214996 | if( zIn[k]=='.' ){ | |
| 214987 | 214997 | jsonAppendChar(pOut, '0'); | |
@@ -217945,7 +217955,9 @@ static int jsonSkipLabel(JsonEachCursor *p){ | |||
| 217945 | 217955 | if( p->eType==JSONB_OBJECT ){ | |
| 217946 | 217956 | u32 sz = 0; | |
| 217947 | 217957 | u32 n = jsonbPayloadSize(&p->sParse, p->i, &sz); | |
| 217948 | - return p->i + n + sz; | ||
| 217958 | + sz += p->i + n; | ||
| 217959 | + if( sz >= p->sParse.nBlob ) sz = p->i; | ||
| 217960 | + return sz; | ||
| 217949 | 217961 | }else{ | |
| 217950 | 217962 | return p->i; | |
| 217951 | 217963 | } | |
@@ -226906,8 +226918,8 @@ static int rbuDeltaApply( | |||
| 226906 | 226918 | int lenDelta, /* Length of the delta */ | |
| 226907 | 226919 | char *zOut /* Write the output into this preallocated buffer */ | |
| 226908 | 226920 | ){ | |
| 226909 | - unsigned int limit; | ||
| 226910 | - unsigned int total = 0; | ||
| 226921 | + sqlite3_uint64 limit; | ||
| 226922 | + sqlite3_uint64 total = 0; | ||
| 226911 | 226923 | #if RBU_ENABLE_DELTA_CKSUM | |
| 226912 | 226924 | char *zOrigOut = zOut; | |
| 226913 | 226925 | #endif | |
@@ -226917,16 +226929,16 @@ static int rbuDeltaApply( | |||
| 226917 | 226929 | /* ERROR: size integer not terminated by "\n" */ | |
| 226918 | 226930 | return -1; | |
| 226919 | 226931 | } | |
| 226920 | - zDelta++; lenDelta--; | ||
| 226921 | - while( *zDelta && lenDelta>0 ){ | ||
| 226932 | + zDelta++; lenDelta--; /* Skip the \n */ | ||
| 226933 | + while( lenDelta>0 && zDelta[0] ){ | ||
| 226922 | 226934 | unsigned int cnt, ofst; | |
| 226923 | 226935 | cnt = rbuDeltaGetInt(&zDelta, &lenDelta); | |
| 226924 | 226936 | if( lenDelta<=0 ) return -1; | |
| 226925 | 226937 | switch( zDelta[0] ){ | |
| 226926 | 226938 | case '@': { | |
| 226927 | 226939 | zDelta++; lenDelta--; | |
| 226928 | 226940 | ofst = rbuDeltaGetInt(&zDelta, &lenDelta); | |
| 226929 | - if( lenDelta>0 || zDelta[0]!=',' ){ | ||
| 226941 | + if( lenDelta>0 && zDelta[0]!=',' ){ | ||
| 226930 | 226942 | /* ERROR: copy command not terminated by ',' */ | |
| 226931 | 226943 | return -1; | |
| 226932 | 226944 | } | |
@@ -226951,7 +226963,7 @@ static int rbuDeltaApply( | |||
| 226951 | 226963 | /* ERROR: insert command gives an output larger than predicted */ | |
| 226952 | 226964 | return -1; | |
| 226953 | 226965 | } | |
| 226954 | - if( (i64)cnt>(i64)lenDelta ){ | ||
| 226966 | + if( cnt>lenDelta ){ | ||
| 226955 | 226967 | /* ERROR: insert count exceeds size of delta */ | |
| 226956 | 226968 | return -1; | |
| 226957 | 226969 | } | |
@@ -228964,13 +228976,13 @@ static int rbuGetUpdateStmt( | |||
| 228964 | 228976 | char *zUpdate = 0; | |
| 228965 | 228977 | ||
| 228966 | 228978 | pUp->zMask = (char*)&pUp[1]; | |
| 228967 | - memcpy(pUp->zMask, zMask, pIter->nTblCol); | ||
| 228968 | 228979 | pUp->pNext = pIter->pRbuUpdate; | |
| 228969 | 228980 | pIter->pRbuUpdate = pUp; | |
| 228970 | 228981 | ||
| 228971 | 228982 | if( zSet ){ | |
| 228972 | 228983 | const char *zPrefix = ""; | |
| 228973 | - | ||
| 228984 | + assert( p->rc==SQLITE_OK ); | ||
| 228985 | + memcpy(pUp->zMask, zMask, pIter->nTblCol); | ||
| 228974 | 228986 | if( pIter->eType!=RBU_PK_VTAB ) zPrefix = "rbu_imp_"; | |
| 228975 | 228987 | zUpdate = sqlite3_mprintf("UPDATE \"%s%w\" SET %s WHERE %s", | |
| 228976 | 228988 | zPrefix, pIter->zTbl, zSet, zWhere | |
@@ -229060,6 +229072,9 @@ static RbuState *rbuLoadState(sqlite3rbu *p){ | |||
| 229060 | 229072 | ||
| 229061 | 229073 | case RBU_STATE_ROW: | |
| 229062 | 229074 | pRet->nRow = sqlite3_column_int(pStmt, 1); | |
| 229075 | + if( pRet->nRow<0 ){ | ||
| 229076 | + rc = SQLITE_CORRUPT; | ||
| 229077 | + } | ||
| 229063 | 229078 | break; | |
| 229064 | 229079 | ||
| 229065 | 229080 | case RBU_STATE_PROGRESS: | |
@@ -240296,7 +240311,12 @@ static int sessionChangesetToHash( | |||
| 240296 | 240311 | ||
| 240297 | 240312 | pIter->in.bNoDiscard = 1; | |
| 240298 | 240313 | while( SQLITE_ROW==(sessionChangesetNext(pIter, &aRec, &nRec, 0)) ){ | |
| 240299 | - rc = sessionOneChangeIterToHash(pGrp, pIter, bRebase); | ||
| 240314 | + if( bRebase && pIter->bPatchset ){ | ||
| 240315 | + /* A patchset may not be used as a rebase */ | ||
| 240316 | + rc = SQLITE_ERROR; | ||
| 240317 | + }else{ | ||
| 240318 | + rc = sessionOneChangeIterToHash(pGrp, pIter, bRebase); | ||
| 240319 | + } | ||
| 240300 | 240320 | if( rc!=SQLITE_OK ) break; | |
| 240301 | 240321 | } | |
| 240302 | 240322 | ||
@@ -240673,13 +240693,14 @@ static void sessionAppendPartialUpdate( | |||
| 240673 | 240693 | int i; | |
| 240674 | 240694 | u8 *a1 = aRec; | |
| 240675 | 240695 | u8 *a2 = aChange; | |
| 240696 | + u8 *a2Eof = &a2[nChange]; | ||
| 240676 | 240697 | ||
| 240677 | 240698 | *pOut++ = SQLITE_UPDATE; | |
| 240678 | 240699 | *pOut++ = pIter->bIndirect; | |
| 240679 | 240700 | for(i=0; i<pIter->nCol; i++){ | |
| 240680 | 240701 | int n1 = sessionSerialLen(a1); | |
| 240681 | - int n2 = sessionSerialLen(a2); | ||
| 240682 | - if( pIter->abPK[i] || a2[0]==0 ){ | ||
| 240702 | + int n2 = (a2>=a2Eof) ? 0 : sessionSerialLen(a2); | ||
| 240703 | + if( n2<=0 || pIter->abPK[i] || a2[0]==0 ){ | ||
| 240683 | 240704 | if( !pIter->abPK[i] && a1[0] ) bData = 1; | |
| 240684 | 240705 | memcpy(pOut, a1, n1); | |
| 240685 | 240706 | pOut += n1; | |
@@ -240880,8 +240901,8 @@ SQLITE_API int sqlite3rebaser_configure( | |||
| 240880 | 240901 | sqlite3_rebaser *p, | |
| 240881 | 240902 | int nRebase, const void *pRebase | |
| 240882 | 240903 | ){ | |
| 240883 | - sqlite3_changeset_iter *pIter = 0; /* Iterator opened on pData/nData */ | ||
| 240884 | 240904 | int rc; /* Return code */ | |
| 240905 | + sqlite3_changeset_iter *pIter = 0; /* Iterator opened on pData/nData */ | ||
| 240885 | 240906 | rc = sqlite3changeset_start(&pIter, nRebase, (void*)pRebase); | |
| 240886 | 240907 | if( rc==SQLITE_OK ){ | |
| 240887 | 240908 | rc = sessionChangesetToHash(pIter, &p->grp, 1); | |
@@ -251701,6 +251722,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ | |||
| 251701 | 251722 | pRet = (Fts5Data*)sqlite3_malloc64(nAlloc); | |
| 251702 | 251723 | if( pRet ){ | |
| 251703 | 251724 | pRet->nn = nByte; | |
| 251725 | + pRet->szLeaf = 0; | ||
| 251704 | 251726 | aOut = pRet->p = (u8*)pRet + szData; | |
| 251705 | 251727 | }else{ | |
| 251706 | 251728 | rc = SQLITE_NOMEM; | |
@@ -251713,10 +251735,8 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){ | |||
| 251713 | 251735 | sqlite3_free(pRet); | |
| 251714 | 251736 | pRet = 0; | |
| 251715 | 251737 | }else{ | |
| 251716 | - /* TODO1: Fix this */ | ||
| 251717 | 251738 | pRet->p[nByte] = 0x00; | |
| 251718 | 251739 | pRet->p[nByte+1] = 0x00; | |
| 251719 | - pRet->szLeaf = fts5GetU16(&pRet->p[2]); | ||
| 251720 | 251740 | } | |
| 251721 | 251741 | } | |
| 251722 | 251742 | p->rc = rc; | |
@@ -251737,9 +251757,17 @@ static void fts5DataRelease(Fts5Data *pData){ | |||
| 251737 | 251757 | sqlite3_free(pData); | |
| 251738 | 251758 | } | |
| 251739 | 251759 | ||
| 251760 | + /* | ||
| 251761 | + ** Read a leaf-page record. This is similar to fts5DataRead(), except that | ||
| 251762 | + ** it fills in the Fts5Data.szLeaf value before returning. | ||
| 251763 | + */ | ||
| 251740 | 251764 | static Fts5Data *fts5LeafRead(Fts5Index *p, i64 iRowid){ | |
| 251741 | 251765 | Fts5Data *pRet = fts5DataRead(p, iRowid); | |
| 251742 | 251766 | if( pRet ){ | |
| 251767 | + assert( pRet->szLeaf==0 ); | ||
| 251768 | + if( pRet->nn>=4 ){ | ||
| 251769 | + pRet->szLeaf = fts5GetU16(&pRet->p[2]); | ||
| 251770 | + } | ||
| 251743 | 251771 | if( pRet->szLeaf<4 || pRet->szLeaf>pRet->nn ){ | |
| 251744 | 251772 | FTS5_CORRUPT_ROWID(p, iRowid); | |
| 251745 | 251773 | fts5DataRelease(pRet); | |
@@ -253649,6 +253677,10 @@ static void fts5SegIterNextInit( | |||
| 253649 | 253677 | ||
| 253650 | 253678 | pIter->iPgidxOff = pIter->pLeaf->szLeaf; | |
| 253651 | 253679 | pIter->iPgidxOff += fts5GetVarint32(&a[pIter->iPgidxOff], iTermOff); | |
| 253680 | + if( iTermOff > pIter->pLeaf->szLeaf ){ | ||
| 253681 | + p->rc = FTS5_CORRUPT; | ||
| 253682 | + return; | ||
| 253683 | + } | ||
| 253652 | 253684 | pIter->iLeafOffset = iTermOff; | |
| 253653 | 253685 | fts5SegIterLoadTerm(p, pIter, 0); | |
| 253654 | 253686 | fts5SegIterLoadNPos(p, pIter); | |
@@ -255975,15 +256007,15 @@ static void fts5SecureDeleteOverflow( | |||
| 255975 | 256007 | int iNext = 0; | |
| 255976 | 256008 | u8 *aPg = 0; | |
| 255977 | 256009 | ||
| 255978 | - pLeaf = fts5DataRead(p, iRowid); | ||
| 256010 | + pLeaf = fts5LeafRead(p, iRowid); | ||
| 255979 | 256011 | if( pLeaf==0 ) break; | |
| 255980 | 256012 | aPg = pLeaf->p; | |
| 255981 | 256013 | ||
| 255982 | 256014 | iNext = fts5GetU16(&aPg[0]); | |
| 255983 | 256015 | if( iNext!=0 ){ | |
| 255984 | 256016 | *pbLastInDoclist = 0; | |
| 255985 | 256017 | } | |
| 255986 | - if( iNext==0 && pLeaf->szLeaf!=pLeaf->nn ){ | ||
| 256018 | + if( iNext==0 && pLeaf->szLeaf<pLeaf->nn ){ | ||
| 255987 | 256019 | fts5GetVarint32(&aPg[pLeaf->szLeaf], iNext); | |
| 255988 | 256020 | } | |
| 255989 | 256021 | ||
@@ -256270,15 +256302,15 @@ static void fts5DoSecureDelete( | |||
| 256270 | 256302 | /* The entry being removed may be the only position list in | |
| 256271 | 256303 | ** its doclist. */ | |
| 256272 | 256304 | for(iPgno=pSeg->iLeafPgno-1; iPgno>pSeg->iTermLeafPgno; iPgno-- ){ | |
| 256273 | - Fts5Data *pPg = fts5DataRead(p, FTS5_SEGMENT_ROWID(iSegid, iPgno)); | ||
| 256305 | + Fts5Data *pPg = fts5LeafRead(p, FTS5_SEGMENT_ROWID(iSegid, iPgno)); | ||
| 256274 | 256306 | int bEmpty = (pPg && pPg->nn==4); | |
| 256275 | 256307 | fts5DataRelease(pPg); | |
| 256276 | 256308 | if( bEmpty==0 ) break; | |
| 256277 | 256309 | } | |
| 256278 | 256310 | ||
| 256279 | 256311 | if( iPgno==pSeg->iTermLeafPgno ){ | |
| 256280 | 256312 | i64 iId = FTS5_SEGMENT_ROWID(iSegid, pSeg->iTermLeafPgno); | |
| 256281 | - Fts5Data *pTerm = fts5DataRead(p, iId); | ||
| 256313 | + Fts5Data *pTerm = fts5LeafRead(p, iId); | ||
| 256282 | 256314 | if( pTerm && pTerm->szLeaf==pSeg->iTermLeafOffset ){ | |
| 256283 | 256315 | u8 *aTermIdx = &pTerm->p[pTerm->szLeaf]; | |
| 256284 | 256316 | int nTermIdx = pTerm->nn - pTerm->szLeaf; | |
@@ -259230,7 +259262,7 @@ static void fts5IndexIntegrityCheckEmpty( | |||
| 259230 | 259262 | /* Now check that the iter.nEmpty leaves following the current leaf | |
| 259231 | 259263 | ** (a) exist and (b) contain no terms. */ | |
| 259232 | 259264 | for(i=iFirst; p->rc==SQLITE_OK && i<=iLast; i++){ | |
| 259233 | - Fts5Data *pLeaf = fts5DataRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, i)); | ||
| 259265 | + Fts5Data *pLeaf = fts5LeafRead(p, FTS5_SEGMENT_ROWID(pSeg->iSegid, i)); | ||
| 259234 | 259266 | if( pLeaf ){ | |
| 259235 | 259267 | if( !fts5LeafIsTermless(pLeaf) | |
| 259236 | 259268 | || (i>=iNoRowid && 0!=fts5LeafFirstRowidOff(pLeaf)) | |
@@ -259358,7 +259390,7 @@ static void fts5IndexIntegrityCheckSegment( | |||
| 259358 | 259390 | FTS5_CORRUPT_ROWID(p, iRow); | |
| 259359 | 259391 | }else{ | |
| 259360 | 259392 | iOff += fts5GetVarint32(&pLeaf->p[iOff], nTerm); | |
| 259361 | - if( iOff+nTerm>pLeaf->szLeaf ){ | ||
| 259393 | + if( (i64)iOff+(i64)nTerm>(i64)pLeaf->szLeaf ){ | ||
| 259362 | 259394 | FTS5_CORRUPT_ROWID(p, iRow); | |
| 259363 | 259395 | }else{ | |
| 259364 | 259396 | res = fts5Memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm)); | |
@@ -263086,19 +263118,23 @@ static int fts5ApiPhraseFirstColumn( | |||
| 263086 | 263118 | ||
| 263087 | 263119 | if( pConfig->eDetail==FTS5_DETAIL_COLUMNS ){ | |
| 263088 | 263120 | Fts5Sorter *pSorter = pCsr->pSorter; | |
| 263089 | - int n; | ||
| 263090 | - if( pSorter ){ | ||
| 263091 | - int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); | ||
| 263092 | - n = pSorter->aIdx[iPhrase] - i1; | ||
| 263093 | - pIter->a = &pSorter->aPoslist[i1]; | ||
| 263121 | + if( iPhrase<0 || iPhrase>=sqlite3Fts5ExprPhraseCount(pCsr->pExpr) ){ | ||
| 263122 | + rc = SQLITE_RANGE; | ||
| 263094 | 263123 | }else{ | |
| 263095 | - rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, iPhrase, &pIter->a, &n); | ||
| 263096 | - } | ||
| 263097 | - if( rc==SQLITE_OK ){ | ||
| 263098 | - assert( pIter->a || n==0 ); | ||
| 263099 | - pIter->b = (pIter->a ? &pIter->a[n] : 0); | ||
| 263100 | - *piCol = 0; | ||
| 263101 | - fts5ApiPhraseNextColumn(pCtx, pIter, piCol); | ||
| 263124 | + int n; | ||
| 263125 | + if( pSorter ){ | ||
| 263126 | + int i1 = (iPhrase==0 ? 0 : pSorter->aIdx[iPhrase-1]); | ||
| 263127 | + n = pSorter->aIdx[iPhrase] - i1; | ||
| 263128 | + pIter->a = &pSorter->aPoslist[i1]; | ||
| 263129 | + }else{ | ||
| 263130 | + rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, iPhrase, &pIter->a, &n); | ||
| 263131 | + } | ||
| 263132 | + if( rc==SQLITE_OK ){ | ||
| 263133 | + assert( pIter->a || n==0 ); | ||
| 263134 | + pIter->b = (pIter->a ? &pIter->a[n] : 0); | ||
| 263135 | + *piCol = 0; | ||
| 263136 | + fts5ApiPhraseNextColumn(pCtx, pIter, piCol); | ||
| 263137 | + } | ||
| 263102 | 263138 | } | |
| 263103 | 263139 | }else{ | |
| 263104 | 263140 | int n; | |
@@ -264006,7 +264042,7 @@ static void fts5SourceIdFunc( | |||
| 264006 | 264042 | ){ | |
| 264007 | 264043 | assert( nArg==0 ); | |
| 264008 | 264044 | UNUSED_PARAM2(nArg, apUnused); | |
| 264009 | - sqlite3_result_text(pCtx, "fts5: 2026-06-26 20:14:12 d4c0e51e4aeb96955b99185ab9cde75c339e2c29c3f3f12428d364a10d782c62", -1, SQLITE_TRANSIENT); | ||
| 264045 | + sqlite3_result_text(pCtx, "fts5: 2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc", -1, SQLITE_TRANSIENT); | ||
| 264010 | 264046 | } | |
| 264011 | 264047 | ||
| 264012 | 264048 | /* | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -146,12 +146,12 @@ extern "C" { | |||
| 146 | 146 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], | |
| 147 | 147 | ** [sqlite_version()] and [sqlite_source_id()]. | |
| 148 | 148 | */ | |
| 149 | - #define SQLITE_VERSION "3.53.3" | ||
| 150 | - #define SQLITE_VERSION_NUMBER 3053003 | ||
| 151 | - #define SQLITE_SOURCE_ID "2026-06-26 20:14:12 d4c0e51e4aeb96955b99185ab9cde75c339e2c29c3f3f12428d364a10d782c62" | ||
| 149 | + #define SQLITE_VERSION "3.53.4" | ||
| 150 | + #define SQLITE_VERSION_NUMBER 3053004 | ||
| 151 | + #define SQLITE_SOURCE_ID "2026-07-24 19:02:57 bf7c7f30031888f4e796e429ab3978879485813aaca6f641c7b33e4e09459bcc" | ||
| 152 | 152 | #define SQLITE_SCM_BRANCH "branch-3.53" | |
| 153 | - #define SQLITE_SCM_TAGS "release version-3.53.3" | ||
| 154 | - #define SQLITE_SCM_DATETIME "2026-06-26T20:14:12.354Z" | ||
| 153 | + #define SQLITE_SCM_TAGS "release version-3.53.4" | ||
| 154 | + #define SQLITE_SCM_DATETIME "2026-07-24T19:02:57.525Z" | ||
| 155 | 155 | ||
| 156 | 156 | /* | |
| 157 | 157 | ** CAPI3REF: Run-Time Library Version Numbers | |
| Back | FazBrowse Home | New Git URL |
0 commit comments