| | @@ -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 | | -** 1091f3371f4af75344c2e6da26656c259fa9 with changes in files: |
| 21 | +** 9adab8b2bef4130abd358d53384cb5f4dd69 with changes in files: |
| 22 | 22 | ** |
| 23 | 23 | ** |
| 24 | 24 | */ |
| 25 | 25 | #ifndef SQLITE_AMALGAMATION |
| 26 | 26 | #define SQLITE_CORE 1 |
| | @@ -467,14 +467,14 @@ |
| 467 | 467 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 468 | 468 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 469 | 469 | */ |
| 470 | 470 | #define SQLITE_VERSION "3.52.0" |
| 471 | 471 | #define SQLITE_VERSION_NUMBER 3052000 |
| 472 | | -#define SQLITE_SOURCE_ID "2026-01-08 15:26:19 1091f3371f4af75344c2e6da26656c259fa96c8a8da9acde3db79df8aa95fd0a" |
| 472 | +#define SQLITE_SOURCE_ID "2026-01-09 00:41:35 9adab8b2bef4130abd358d53384cb5f4dd691b808336bb7102793b0165b1c516" |
| 473 | 473 | #define SQLITE_SCM_BRANCH "trunk" |
| 474 | 474 | #define SQLITE_SCM_TAGS "" |
| 475 | | -#define SQLITE_SCM_DATETIME "2026-01-08T15:26:19.338Z" |
| 475 | +#define SQLITE_SCM_DATETIME "2026-01-09T00:41:35.433Z" |
| 476 | 476 | |
| 477 | 477 | /* |
| 478 | 478 | ** CAPI3REF: Run-Time Library Version Numbers |
| 479 | 479 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 480 | 480 | ** |
| | @@ -160159,13 +160159,15 @@ |
| 160159 | 160159 | if( rc!=SQLITE_OK ) goto end_of_vacuum; |
| 160160 | 160160 | assert( (db->nDb-1)==nDb ); |
| 160161 | 160161 | pDb = &db->aDb[nDb]; |
| 160162 | 160162 | assert( strcmp(pDb->zDbSName,zDbVacuum)==0 ); |
| 160163 | 160163 | pTemp = pDb->pBt; |
| 160164 | + nRes = sqlite3BtreeGetRequestedReserve(pMain); |
| 160164 | 160165 | if( pOut ){ |
| 160165 | 160166 | sqlite3_file *id = sqlite3PagerFile(sqlite3BtreePager(pTemp)); |
| 160166 | 160167 | i64 sz = 0; |
| 160168 | + const char *zFilename; |
| 160167 | 160169 | if( id->pMethods!=0 && (sqlite3OsFileSize(id, &sz)!=SQLITE_OK || sz>0) ){ |
| 160168 | 160170 | rc = SQLITE_ERROR; |
| 160169 | 160171 | sqlite3SetString(pzErrMsg, db, "output file already exists"); |
| 160170 | 160172 | goto end_of_vacuum; |
| 160171 | 160173 | } |
| | @@ -160173,12 +160175,20 @@ |
| 160173 | 160175 | |
| 160174 | 160176 | /* For a VACUUM INTO, the pager-flags are set to the same values as |
| 160175 | 160177 | ** they are for the database being vacuumed, except that PAGER_CACHESPILL |
| 160176 | 160178 | ** is always set. */ |
| 160177 | 160179 | pgflags = db->aDb[iDb].safety_level | (db->flags & PAGER_FLAGS_MASK); |
| 160180 | + |
| 160181 | + /* If the VACUUM INTO target file is a URI filename and if the |
| 160182 | + ** "reserve=N" query parameter is present, reset the reserve to the |
| 160183 | + ** amount specified, if the amount is within range */ |
| 160184 | + zFilename = sqlite3BtreeGetFilename(pTemp); |
| 160185 | + if( ALWAYS(zFilename) ){ |
| 160186 | + int nNew = (int)sqlite3_uri_int64(zFilename, "reserve", nRes); |
| 160187 | + if( nNew>=0 && nNew<=255 ) nRes = nNew; |
| 160188 | + } |
| 160178 | 160189 | } |
| 160179 | | - nRes = sqlite3BtreeGetRequestedReserve(pMain); |
| 160180 | 160190 | |
| 160181 | 160191 | sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size); |
| 160182 | 160192 | sqlite3BtreeSetSpillSize(pTemp, sqlite3BtreeSetSpillSize(pMain,0)); |
| 160183 | 160193 | sqlite3BtreeSetPagerFlags(pTemp, pgflags|PAGER_CACHESPILL); |
| 160184 | 160194 | |
| | @@ -220293,11 +220303,11 @@ |
| 220293 | 220303 | tree.nBytesPerCell = 8 + 8 * tree.nDim; |
| 220294 | 220304 | node.zData = (u8 *)sqlite3_value_blob(apArg[1]); |
| 220295 | 220305 | if( node.zData==0 ) return; |
| 220296 | 220306 | nData = sqlite3_value_bytes(apArg[1]); |
| 220297 | 220307 | if( nData<4 ) return; |
| 220298 | | - if( nData<NCELL(&node)*tree.nBytesPerCell ) return; |
| 220308 | + if( nData<4+NCELL(&node)*tree.nBytesPerCell ) return; |
| 220299 | 220309 | |
| 220300 | 220310 | pOut = sqlite3_str_new(0); |
| 220301 | 220311 | for(ii=0; ii<NCELL(&node); ii++){ |
| 220302 | 220312 | RtreeCell cell; |
| 220303 | 220313 | int jj; |
| | @@ -261170,11 +261180,11 @@ |
| 261170 | 261180 | int nArg, /* Number of args */ |
| 261171 | 261181 | sqlite3_value **apUnused /* Function arguments */ |
| 261172 | 261182 | ){ |
| 261173 | 261183 | assert( nArg==0 ); |
| 261174 | 261184 | UNUSED_PARAM2(nArg, apUnused); |
| 261175 | | - sqlite3_result_text(pCtx, "fts5: 2026-01-08 12:22:50 762d3cbf06218f1010425a98a71ebf7623b84b45a90e6419b7dec7f10ad0c5a5", -1, SQLITE_TRANSIENT); |
| 261185 | + sqlite3_result_text(pCtx, "fts5: 2026-01-09 00:41:35 9adab8b2bef4130abd358d53384cb5f4dd691b808336bb7102793b0165b1c516", -1, SQLITE_TRANSIENT); |
| 261176 | 261186 | } |
| 261177 | 261187 | |
| 261178 | 261188 | /* |
| 261179 | 261189 | ** Implementation of fts5_locale(LOCALE, TEXT) function. |
| 261180 | 261190 | ** |
| 261181 | 261191 | |