Fossil SCM
Update the built-in SQLite to version 3.31.1 plus the s390x architecture fix.
Commit
e8f24f7ecdc1707d8b66cee982d00ddece8d6d6bf9582b567992da0e8c443200
Parent
514dd66f3354dec…
2 files changed
+93
-63
+3
-3
+93
-63
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | /****************************************************************************** |
| 2 | 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | -** version 3.31.0. By combining all the individual C code files into this | |
| 3 | +** version 3.31.1. 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 |
| 7 | 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | 8 | ** translation unit. |
| @@ -1163,13 +1163,13 @@ | ||
| 1163 | 1163 | ** |
| 1164 | 1164 | ** See also: [sqlite3_libversion()], |
| 1165 | 1165 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1166 | 1166 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1167 | 1167 | */ |
| 1168 | -#define SQLITE_VERSION "3.31.0" | |
| 1169 | -#define SQLITE_VERSION_NUMBER 3031000 | |
| 1170 | -#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" | |
| 1168 | +#define SQLITE_VERSION "3.31.1" | |
| 1169 | +#define SQLITE_VERSION_NUMBER 3031001 | |
| 1170 | +#define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e" | |
| 1171 | 1171 | |
| 1172 | 1172 | /* |
| 1173 | 1173 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1174 | 1174 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1175 | 1175 | ** |
| @@ -56231,34 +56231,52 @@ | ||
| 56231 | 56231 | ** Pager object (sizeof(Pager) bytes) |
| 56232 | 56232 | ** PCache object (sqlite3PcacheSize() bytes) |
| 56233 | 56233 | ** Database file handle (pVfs->szOsFile bytes) |
| 56234 | 56234 | ** Sub-journal file handle (journalFileSize bytes) |
| 56235 | 56235 | ** Main journal file handle (journalFileSize bytes) |
| 56236 | - ** \0\1\0 journal prefix (3 bytes) | |
| 56237 | - ** Journal filename (nPathname+8+1 bytes) | |
| 56238 | - ** \2\0 WAL prefix (2 bytes) | |
| 56239 | - ** WAL filename (nPathname+4+1 bytes) | |
| 56240 | - ** \3\0 database prefix (2 bytes) | |
| 56236 | + ** \0\0\0\0 database prefix (4 bytes) | |
| 56241 | 56237 | ** Database file name (nPathname+1 bytes) |
| 56242 | 56238 | ** URI query parameters (nUriByte bytes) |
| 56243 | - ** \0\0 terminator (2 bytes) | |
| 56239 | + ** Journal filename (nPathname+8+1 bytes) | |
| 56240 | + ** WAL filename (nPathname+4+1 bytes) | |
| 56241 | + ** \0\0\0 terminator (3 bytes) | |
| 56242 | + ** | |
| 56243 | + ** Some 3rd-party software, over which we have no control, depends on | |
| 56244 | + ** the specific order of the filenames and the \0 separators between them | |
| 56245 | + ** so that it can (for example) find the database filename given the WAL | |
| 56246 | + ** filename without using the sqlite3_filename_database() API. This is a | |
| 56247 | + ** misuse of SQLite and a bug in the 3rd-party software, but the 3rd-party | |
| 56248 | + ** software is in widespread use, so we try to avoid changing the filename | |
| 56249 | + ** order and formatting if possible. In particular, the details of the | |
| 56250 | + ** filename format expected by 3rd-party software should be as follows: | |
| 56251 | + ** | |
| 56252 | + ** - Main Database Path | |
| 56253 | + ** - \0 | |
| 56254 | + ** - Multiple URI components consisting of: | |
| 56255 | + ** - Key | |
| 56256 | + ** - \0 | |
| 56257 | + ** - Value | |
| 56258 | + ** - \0 | |
| 56259 | + ** - \0 | |
| 56260 | + ** - Journal Path | |
| 56261 | + ** - \0 | |
| 56262 | + ** - WAL Path (zWALName) | |
| 56263 | + ** - \0 | |
| 56244 | 56264 | */ |
| 56245 | 56265 | pPtr = (u8 *)sqlite3MallocZero( |
| 56246 | 56266 | ROUND8(sizeof(*pPager)) + /* Pager structure */ |
| 56247 | 56267 | ROUND8(pcacheSize) + /* PCache object */ |
| 56248 | 56268 | ROUND8(pVfs->szOsFile) + /* The main db file */ |
| 56249 | 56269 | journalFileSize * 2 + /* The two journal files */ |
| 56250 | - 3 + /* Journal prefix */ | |
| 56270 | + 4 + /* Database prefix */ | |
| 56271 | + nPathname + 1 + /* database filename */ | |
| 56272 | + nUriByte + /* query parameters */ | |
| 56251 | 56273 | nPathname + 8 + 1 + /* Journal filename */ |
| 56252 | 56274 | #ifndef SQLITE_OMIT_WAL |
| 56253 | - 2 + /* WAL prefix */ | |
| 56254 | 56275 | nPathname + 4 + 1 + /* WAL filename */ |
| 56255 | 56276 | #endif |
| 56256 | - 2 + /* Database prefix */ | |
| 56257 | - nPathname + 1 + /* database filename */ | |
| 56258 | - nUriByte + /* query parameters */ | |
| 56259 | - 2 /* Terminator */ | |
| 56277 | + 3 /* Terminator */ | |
| 56260 | 56278 | ); |
| 56261 | 56279 | assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) ); |
| 56262 | 56280 | if( !pPtr ){ |
| 56263 | 56281 | sqlite3DbFree(0, zPathname); |
| 56264 | 56282 | return SQLITE_NOMEM_BKPT; |
| @@ -56268,13 +56286,24 @@ | ||
| 56268 | 56286 | pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile); |
| 56269 | 56287 | pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56270 | 56288 | pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56271 | 56289 | assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) ); |
| 56272 | 56290 | |
| 56291 | + /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ | |
| 56292 | + pPtr += 4; /* Skip zero prefix */ | |
| 56293 | + pPager->zFilename = (char*)pPtr; | |
| 56294 | + if( nPathname>0 ){ | |
| 56295 | + memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1; | |
| 56296 | + if( zUri ){ | |
| 56297 | + memcpy(pPtr, zUri, nUriByte); pPtr += nUriByte; | |
| 56298 | + }else{ | |
| 56299 | + pPtr++; | |
| 56300 | + } | |
| 56301 | + } | |
| 56302 | + | |
| 56273 | 56303 | |
| 56274 | 56304 | /* Fill in Pager.zJournal */ |
| 56275 | - pPtr[1] = '\001'; pPtr += 3; | |
| 56276 | 56305 | if( nPathname>0 ){ |
| 56277 | 56306 | pPager->zJournal = (char*)pPtr; |
| 56278 | 56307 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56279 | 56308 | memcpy(pPtr, "-journal",8); pPtr += 8 + 1; |
| 56280 | 56309 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56281,16 +56310,14 @@ | ||
| 56281 | 56310 | sqlite3FileSuffix3(zFilename,pPager->zJournal); |
| 56282 | 56311 | pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1); |
| 56283 | 56312 | #endif |
| 56284 | 56313 | }else{ |
| 56285 | 56314 | pPager->zJournal = 0; |
| 56286 | - pPtr++; | |
| 56287 | 56315 | } |
| 56288 | 56316 | |
| 56289 | 56317 | #ifndef SQLITE_OMIT_WAL |
| 56290 | 56318 | /* Fill in Pager.zWal */ |
| 56291 | - pPtr[0] = '\002'; pPtr[1] = 0; pPtr += 2; | |
| 56292 | 56319 | if( nPathname>0 ){ |
| 56293 | 56320 | pPager->zWal = (char*)pPtr; |
| 56294 | 56321 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56295 | 56322 | memcpy(pPtr, "-wal", 4); pPtr += 4 + 1; |
| 56296 | 56323 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56297,25 +56324,13 @@ | ||
| 56297 | 56324 | sqlite3FileSuffix3(zFilename, pPager->zWal); |
| 56298 | 56325 | pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1); |
| 56299 | 56326 | #endif |
| 56300 | 56327 | }else{ |
| 56301 | 56328 | pPager->zWal = 0; |
| 56302 | - pPtr++; | |
| 56303 | 56329 | } |
| 56304 | 56330 | #endif |
| 56305 | 56331 | |
| 56306 | - /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ | |
| 56307 | - pPtr[0] = '\003'; pPtr[1] = 0; pPtr += 2; | |
| 56308 | - pPager->zFilename = (char*)pPtr; | |
| 56309 | - if( nPathname>0 ){ | |
| 56310 | - memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1; | |
| 56311 | - if( zUri ){ | |
| 56312 | - memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */ | |
| 56313 | - } | |
| 56314 | - /* Double-zero terminator implied by the sqlite3MallocZero */ | |
| 56315 | - } | |
| 56316 | - | |
| 56317 | 56332 | if( nPathname ) sqlite3DbFree(0, zPathname); |
| 56318 | 56333 | pPager->pVfs = pVfs; |
| 56319 | 56334 | pPager->vfsFlags = vfsFlags; |
| 56320 | 56335 | |
| 56321 | 56336 | /* Open the pager file. |
| @@ -58431,12 +58446,12 @@ | ||
| 58431 | 58446 | ** |
| 58432 | 58447 | ** The return value to this routine is always safe to use with |
| 58433 | 58448 | ** sqlite3_uri_parameter() and sqlite3_filename_database() and friends. |
| 58434 | 58449 | */ |
| 58435 | 58450 | SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager *pPager, int nullIfMemDb){ |
| 58436 | - static const char zFake[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; | |
| 58437 | - return (nullIfMemDb && pPager->memDb) ? &zFake[3] : pPager->zFilename; | |
| 58451 | + static const char zFake[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; | |
| 58452 | + return (nullIfMemDb && pPager->memDb) ? &zFake[4] : pPager->zFilename; | |
| 58438 | 58453 | } |
| 58439 | 58454 | |
| 58440 | 58455 | /* |
| 58441 | 58456 | ** Return the VFS structure for the pager. |
| 58442 | 58457 | */ |
| @@ -117489,10 +117504,13 @@ | ||
| 117489 | 117504 | return 0; |
| 117490 | 117505 | } |
| 117491 | 117506 | assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); |
| 117492 | 117507 | nExpr = pExpr->x.pList->nExpr; |
| 117493 | 117508 | pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0); |
| 117509 | +#ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION | |
| 117510 | + if( pDef==0 ) return 0; | |
| 117511 | +#endif | |
| 117494 | 117512 | if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
| 117495 | 117513 | return 0; |
| 117496 | 117514 | } |
| 117497 | 117515 | if( nExpr<3 ){ |
| 117498 | 117516 | aWc[3] = 0; |
| @@ -121282,16 +121300,18 @@ | ||
| 121282 | 121300 | ** Hence, make a complete copy of the opcode, rather than using |
| 121283 | 121301 | ** a pointer to the opcode. */ |
| 121284 | 121302 | x = *sqlite3VdbeGetOp(v, addrConflictCk); |
| 121285 | 121303 | if( x.opcode!=OP_IdxRowid ){ |
| 121286 | 121304 | int p2; /* New P2 value for copied conflict check opcode */ |
| 121305 | + const char *zP4; | |
| 121287 | 121306 | if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){ |
| 121288 | 121307 | p2 = lblRecheckOk; |
| 121289 | 121308 | }else{ |
| 121290 | 121309 | p2 = x.p2; |
| 121291 | 121310 | } |
| 121292 | - sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, x.p4.z, x.p4type); | |
| 121311 | + zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z; | |
| 121312 | + sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, zP4, x.p4type); | |
| 121293 | 121313 | sqlite3VdbeChangeP5(v, x.p5); |
| 121294 | 121314 | VdbeCoverageIf(v, p2!=x.p2); |
| 121295 | 121315 | } |
| 121296 | 121316 | nConflictCk--; |
| 121297 | 121317 | addrConflictCk++; |
| @@ -122765,15 +122785,15 @@ | ||
| 122765 | 122785 | /* Version 3.25.0 and later */ |
| 122766 | 122786 | #define sqlite3_create_window_function sqlite3_api->create_window_function |
| 122767 | 122787 | /* Version 3.26.0 and later */ |
| 122768 | 122788 | #define sqlite3_normalized_sql sqlite3_api->normalized_sql |
| 122769 | 122789 | /* Version 3.28.0 and later */ |
| 122770 | -#define sqlite3_stmt_isexplain sqlite3_api->isexplain | |
| 122771 | -#define sqlite3_value_frombind sqlite3_api->frombind | |
| 122790 | +#define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain | |
| 122791 | +#define sqlite3_value_frombind sqlite3_api->value_frombind | |
| 122772 | 122792 | /* Version 3.30.0 and later */ |
| 122773 | 122793 | #define sqlite3_drop_modules sqlite3_api->drop_modules |
| 122774 | -/* Version 3.31.0 andn later */ | |
| 122794 | +/* Version 3.31.0 and later */ | |
| 122775 | 122795 | #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64 |
| 122776 | 122796 | #define sqlite3_uri_key sqlite3_api->uri_key |
| 122777 | 122797 | #define sqlite3_filename_database sqlite3_api->filename_database |
| 122778 | 122798 | #define sqlite3_filename_journal sqlite3_api->filename_journal |
| 122779 | 122799 | #define sqlite3_filename_wal sqlite3_api->filename_wal |
| @@ -163279,10 +163299,25 @@ | ||
| 163279 | 163299 | } |
| 163280 | 163300 | va_end(ap); |
| 163281 | 163301 | #endif /* SQLITE_UNTESTABLE */ |
| 163282 | 163302 | return rc; |
| 163283 | 163303 | } |
| 163304 | + | |
| 163305 | +/* | |
| 163306 | +** The Pager stores the Database filename, Journal filename, and WAL filename | |
| 163307 | +** consecutively in memory, in that order. The database filename is prefixed | |
| 163308 | +** by four zero bytes. Locate the start of the database filename by searching | |
| 163309 | +** backwards for the first byte following four consecutive zero bytes. | |
| 163310 | +** | |
| 163311 | +** This only works if the filename passed in was obtained from the Pager. | |
| 163312 | +*/ | |
| 163313 | +static const char *databaseName(const char *zName){ | |
| 163314 | + while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ | |
| 163315 | + zName--; | |
| 163316 | + } | |
| 163317 | + return zName; | |
| 163318 | +} | |
| 163284 | 163319 | |
| 163285 | 163320 | /* |
| 163286 | 163321 | ** This is a utility routine, useful to VFS implementations, that checks |
| 163287 | 163322 | ** to see if a database file was a URI that contained a specific query |
| 163288 | 163323 | ** parameter, and if so obtains the value of the query parameter. |
| @@ -163293,10 +163328,11 @@ | ||
| 163293 | 163328 | ** parameter if it exists. If the parameter does not exist, this routine |
| 163294 | 163329 | ** returns a NULL pointer. |
| 163295 | 163330 | */ |
| 163296 | 163331 | SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 163297 | 163332 | if( zFilename==0 || zParam==0 ) return 0; |
| 163333 | + zFilename = databaseName(zFilename); | |
| 163298 | 163334 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163299 | 163335 | while( zFilename[0] ){ |
| 163300 | 163336 | int x = strcmp(zFilename, zParam); |
| 163301 | 163337 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163302 | 163338 | if( x==0 ) return zFilename; |
| @@ -163308,10 +163344,11 @@ | ||
| 163308 | 163344 | /* |
| 163309 | 163345 | ** Return a pointer to the name of Nth query parameter of the filename. |
| 163310 | 163346 | */ |
| 163311 | 163347 | SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){ |
| 163312 | 163348 | if( zFilename==0 || N<0 ) return 0; |
| 163349 | + zFilename = databaseName(zFilename); | |
| 163313 | 163350 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163314 | 163351 | while( zFilename[0] && (N--)>0 ){ |
| 163315 | 163352 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163316 | 163353 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163317 | 163354 | } |
| @@ -163341,29 +163378,10 @@ | ||
| 163341 | 163378 | bDflt = v; |
| 163342 | 163379 | } |
| 163343 | 163380 | return bDflt; |
| 163344 | 163381 | } |
| 163345 | 163382 | |
| 163346 | -/* | |
| 163347 | -** The Pager stores the Journal filename, WAL filename, and Database filename | |
| 163348 | -** consecutively in memory, in that order, with prefixes \000\001\000, | |
| 163349 | -** \002\000, and \003\000, in that order. Thus the three names look like query | |
| 163350 | -** parameters if you start at the first prefix. | |
| 163351 | -** | |
| 163352 | -** This routine backs up a filename to the start of the first prefix. | |
| 163353 | -** | |
| 163354 | -** This only works if the filenamed passed in was obtained from the Pager. | |
| 163355 | -*/ | |
| 163356 | -static const char *startOfNameList(const char *zName){ | |
| 163357 | - while( zName[0]!='\001' || zName[1]!=0 ){ | |
| 163358 | - zName -= 3; | |
| 163359 | - while( zName[0]!='\000' ){ zName--; } | |
| 163360 | - zName++; | |
| 163361 | - } | |
| 163362 | - return zName-1; | |
| 163363 | -} | |
| 163364 | - | |
| 163365 | 163383 | /* |
| 163366 | 163384 | ** Translate a filename that was handed to a VFS routine into the corresponding |
| 163367 | 163385 | ** database, journal, or WAL file. |
| 163368 | 163386 | ** |
| 163369 | 163387 | ** It is an error to pass this routine a filename string that was not |
| @@ -163371,18 +163389,30 @@ | ||
| 163371 | 163389 | ** passing free() a pointer that was not obtained from malloc() - it is |
| 163372 | 163390 | ** an error that we cannot easily detect but that will likely cause memory |
| 163373 | 163391 | ** corruption. |
| 163374 | 163392 | */ |
| 163375 | 163393 | SQLITE_API const char *sqlite3_filename_database(const char *zFilename){ |
| 163394 | + return databaseName(zFilename); | |
| 163376 | 163395 | return sqlite3_uri_parameter(zFilename - 3, "\003"); |
| 163377 | 163396 | } |
| 163378 | 163397 | SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){ |
| 163379 | - const char *z = sqlite3_uri_parameter(startOfNameList(zFilename), "\001"); | |
| 163380 | - return ALWAYS(z) && z[0] ? z : 0; | |
| 163398 | + zFilename = databaseName(zFilename); | |
| 163399 | + zFilename += sqlite3Strlen30(zFilename) + 1; | |
| 163400 | + while( zFilename[0] ){ | |
| 163401 | + zFilename += sqlite3Strlen30(zFilename) + 1; | |
| 163402 | + zFilename += sqlite3Strlen30(zFilename) + 1; | |
| 163403 | + } | |
| 163404 | + return zFilename + 1; | |
| 163381 | 163405 | } |
| 163382 | 163406 | SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){ |
| 163383 | - return sqlite3_uri_parameter(startOfNameList(zFilename), "\002"); | |
| 163407 | +#ifdef SQLITE_OMIT_WAL | |
| 163408 | + return 0; | |
| 163409 | +#else | |
| 163410 | + zFilename = sqlite3_filename_journal(zFilename); | |
| 163411 | + zFilename += sqlite3Strlen30(zFilename) + 1; | |
| 163412 | + return zFilename; | |
| 163413 | +#endif | |
| 163384 | 163414 | } |
| 163385 | 163415 | |
| 163386 | 163416 | /* |
| 163387 | 163417 | ** Return the Btree pointer identified by zDbName. Return NULL if not found. |
| 163388 | 163418 | */ |
| @@ -219997,12 +220027,12 @@ | ||
| 219997 | 220027 | ** Check if buffer z[], size n bytes, contains as series of valid utf-8 |
| 219998 | 220028 | ** encoded codepoints. If so, return 0. Otherwise, if the buffer does not |
| 219999 | 220029 | ** contain valid utf-8, return non-zero. |
| 220000 | 220030 | */ |
| 220001 | 220031 | static int fts5TestUtf8(const char *z, int n){ |
| 220002 | - assert_nc( n>0 ); | |
| 220003 | 220032 | int i = 0; |
| 220033 | + assert_nc( n>0 ); | |
| 220004 | 220034 | while( i<n ){ |
| 220005 | 220035 | if( (z[i] & 0x80)==0x00 ){ |
| 220006 | 220036 | i++; |
| 220007 | 220037 | }else |
| 220008 | 220038 | if( (z[i] & 0xE0)==0xC0 ){ |
| @@ -223637,11 +223667,11 @@ | ||
| 223637 | 223667 | int nArg, /* Number of args */ |
| 223638 | 223668 | sqlite3_value **apUnused /* Function arguments */ |
| 223639 | 223669 | ){ |
| 223640 | 223670 | assert( nArg==0 ); |
| 223641 | 223671 | UNUSED_PARAM2(nArg, apUnused); |
| 223642 | - sqlite3_result_text(pCtx, "fts5: 2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824", -1, SQLITE_TRANSIENT); | |
| 223672 | + sqlite3_result_text(pCtx, "fts5: 2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e", -1, SQLITE_TRANSIENT); | |
| 223643 | 223673 | } |
| 223644 | 223674 | |
| 223645 | 223675 | /* |
| 223646 | 223676 | ** Return true if zName is the extension on one of the shadow tables used |
| 223647 | 223677 | ** by this module. |
| @@ -228410,12 +228440,12 @@ | ||
| 228410 | 228440 | } |
| 228411 | 228441 | #endif /* SQLITE_CORE */ |
| 228412 | 228442 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 228413 | 228443 | |
| 228414 | 228444 | /************** End of stmt.c ************************************************/ |
| 228415 | -#if __LINE__!=228415 | |
| 228445 | +#if __LINE__!=228445 | |
| 228416 | 228446 | #undef SQLITE_SOURCE_ID |
| 228417 | -#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86alt2" | |
| 228447 | +#define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563alt2" | |
| 228418 | 228448 | #endif |
| 228419 | 228449 | /* Return the source-id for this library */ |
| 228420 | 228450 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 228421 | 228451 | /************************** End of sqlite3.c ******************************/ |
| 228422 | 228452 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.31.0. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -1163,13 +1163,13 @@ | |
| 1163 | ** |
| 1164 | ** See also: [sqlite3_libversion()], |
| 1165 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1166 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1167 | */ |
| 1168 | #define SQLITE_VERSION "3.31.0" |
| 1169 | #define SQLITE_VERSION_NUMBER 3031000 |
| 1170 | #define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" |
| 1171 | |
| 1172 | /* |
| 1173 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1174 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1175 | ** |
| @@ -56231,34 +56231,52 @@ | |
| 56231 | ** Pager object (sizeof(Pager) bytes) |
| 56232 | ** PCache object (sqlite3PcacheSize() bytes) |
| 56233 | ** Database file handle (pVfs->szOsFile bytes) |
| 56234 | ** Sub-journal file handle (journalFileSize bytes) |
| 56235 | ** Main journal file handle (journalFileSize bytes) |
| 56236 | ** \0\1\0 journal prefix (3 bytes) |
| 56237 | ** Journal filename (nPathname+8+1 bytes) |
| 56238 | ** \2\0 WAL prefix (2 bytes) |
| 56239 | ** WAL filename (nPathname+4+1 bytes) |
| 56240 | ** \3\0 database prefix (2 bytes) |
| 56241 | ** Database file name (nPathname+1 bytes) |
| 56242 | ** URI query parameters (nUriByte bytes) |
| 56243 | ** \0\0 terminator (2 bytes) |
| 56244 | */ |
| 56245 | pPtr = (u8 *)sqlite3MallocZero( |
| 56246 | ROUND8(sizeof(*pPager)) + /* Pager structure */ |
| 56247 | ROUND8(pcacheSize) + /* PCache object */ |
| 56248 | ROUND8(pVfs->szOsFile) + /* The main db file */ |
| 56249 | journalFileSize * 2 + /* The two journal files */ |
| 56250 | 3 + /* Journal prefix */ |
| 56251 | nPathname + 8 + 1 + /* Journal filename */ |
| 56252 | #ifndef SQLITE_OMIT_WAL |
| 56253 | 2 + /* WAL prefix */ |
| 56254 | nPathname + 4 + 1 + /* WAL filename */ |
| 56255 | #endif |
| 56256 | 2 + /* Database prefix */ |
| 56257 | nPathname + 1 + /* database filename */ |
| 56258 | nUriByte + /* query parameters */ |
| 56259 | 2 /* Terminator */ |
| 56260 | ); |
| 56261 | assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) ); |
| 56262 | if( !pPtr ){ |
| 56263 | sqlite3DbFree(0, zPathname); |
| 56264 | return SQLITE_NOMEM_BKPT; |
| @@ -56268,13 +56286,24 @@ | |
| 56268 | pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile); |
| 56269 | pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56270 | pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56271 | assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) ); |
| 56272 | |
| 56273 | |
| 56274 | /* Fill in Pager.zJournal */ |
| 56275 | pPtr[1] = '\001'; pPtr += 3; |
| 56276 | if( nPathname>0 ){ |
| 56277 | pPager->zJournal = (char*)pPtr; |
| 56278 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56279 | memcpy(pPtr, "-journal",8); pPtr += 8 + 1; |
| 56280 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56281,16 +56310,14 @@ | |
| 56281 | sqlite3FileSuffix3(zFilename,pPager->zJournal); |
| 56282 | pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1); |
| 56283 | #endif |
| 56284 | }else{ |
| 56285 | pPager->zJournal = 0; |
| 56286 | pPtr++; |
| 56287 | } |
| 56288 | |
| 56289 | #ifndef SQLITE_OMIT_WAL |
| 56290 | /* Fill in Pager.zWal */ |
| 56291 | pPtr[0] = '\002'; pPtr[1] = 0; pPtr += 2; |
| 56292 | if( nPathname>0 ){ |
| 56293 | pPager->zWal = (char*)pPtr; |
| 56294 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56295 | memcpy(pPtr, "-wal", 4); pPtr += 4 + 1; |
| 56296 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56297,25 +56324,13 @@ | |
| 56297 | sqlite3FileSuffix3(zFilename, pPager->zWal); |
| 56298 | pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1); |
| 56299 | #endif |
| 56300 | }else{ |
| 56301 | pPager->zWal = 0; |
| 56302 | pPtr++; |
| 56303 | } |
| 56304 | #endif |
| 56305 | |
| 56306 | /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ |
| 56307 | pPtr[0] = '\003'; pPtr[1] = 0; pPtr += 2; |
| 56308 | pPager->zFilename = (char*)pPtr; |
| 56309 | if( nPathname>0 ){ |
| 56310 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1; |
| 56311 | if( zUri ){ |
| 56312 | memcpy(pPtr, zUri, nUriByte); /* pPtr += nUriByte; // not needed */ |
| 56313 | } |
| 56314 | /* Double-zero terminator implied by the sqlite3MallocZero */ |
| 56315 | } |
| 56316 | |
| 56317 | if( nPathname ) sqlite3DbFree(0, zPathname); |
| 56318 | pPager->pVfs = pVfs; |
| 56319 | pPager->vfsFlags = vfsFlags; |
| 56320 | |
| 56321 | /* Open the pager file. |
| @@ -58431,12 +58446,12 @@ | |
| 58431 | ** |
| 58432 | ** The return value to this routine is always safe to use with |
| 58433 | ** sqlite3_uri_parameter() and sqlite3_filename_database() and friends. |
| 58434 | */ |
| 58435 | SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager *pPager, int nullIfMemDb){ |
| 58436 | static const char zFake[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; |
| 58437 | return (nullIfMemDb && pPager->memDb) ? &zFake[3] : pPager->zFilename; |
| 58438 | } |
| 58439 | |
| 58440 | /* |
| 58441 | ** Return the VFS structure for the pager. |
| 58442 | */ |
| @@ -117489,10 +117504,13 @@ | |
| 117489 | return 0; |
| 117490 | } |
| 117491 | assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); |
| 117492 | nExpr = pExpr->x.pList->nExpr; |
| 117493 | pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0); |
| 117494 | if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
| 117495 | return 0; |
| 117496 | } |
| 117497 | if( nExpr<3 ){ |
| 117498 | aWc[3] = 0; |
| @@ -121282,16 +121300,18 @@ | |
| 121282 | ** Hence, make a complete copy of the opcode, rather than using |
| 121283 | ** a pointer to the opcode. */ |
| 121284 | x = *sqlite3VdbeGetOp(v, addrConflictCk); |
| 121285 | if( x.opcode!=OP_IdxRowid ){ |
| 121286 | int p2; /* New P2 value for copied conflict check opcode */ |
| 121287 | if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){ |
| 121288 | p2 = lblRecheckOk; |
| 121289 | }else{ |
| 121290 | p2 = x.p2; |
| 121291 | } |
| 121292 | sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, x.p4.z, x.p4type); |
| 121293 | sqlite3VdbeChangeP5(v, x.p5); |
| 121294 | VdbeCoverageIf(v, p2!=x.p2); |
| 121295 | } |
| 121296 | nConflictCk--; |
| 121297 | addrConflictCk++; |
| @@ -122765,15 +122785,15 @@ | |
| 122765 | /* Version 3.25.0 and later */ |
| 122766 | #define sqlite3_create_window_function sqlite3_api->create_window_function |
| 122767 | /* Version 3.26.0 and later */ |
| 122768 | #define sqlite3_normalized_sql sqlite3_api->normalized_sql |
| 122769 | /* Version 3.28.0 and later */ |
| 122770 | #define sqlite3_stmt_isexplain sqlite3_api->isexplain |
| 122771 | #define sqlite3_value_frombind sqlite3_api->frombind |
| 122772 | /* Version 3.30.0 and later */ |
| 122773 | #define sqlite3_drop_modules sqlite3_api->drop_modules |
| 122774 | /* Version 3.31.0 andn later */ |
| 122775 | #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64 |
| 122776 | #define sqlite3_uri_key sqlite3_api->uri_key |
| 122777 | #define sqlite3_filename_database sqlite3_api->filename_database |
| 122778 | #define sqlite3_filename_journal sqlite3_api->filename_journal |
| 122779 | #define sqlite3_filename_wal sqlite3_api->filename_wal |
| @@ -163279,10 +163299,25 @@ | |
| 163279 | } |
| 163280 | va_end(ap); |
| 163281 | #endif /* SQLITE_UNTESTABLE */ |
| 163282 | return rc; |
| 163283 | } |
| 163284 | |
| 163285 | /* |
| 163286 | ** This is a utility routine, useful to VFS implementations, that checks |
| 163287 | ** to see if a database file was a URI that contained a specific query |
| 163288 | ** parameter, and if so obtains the value of the query parameter. |
| @@ -163293,10 +163328,11 @@ | |
| 163293 | ** parameter if it exists. If the parameter does not exist, this routine |
| 163294 | ** returns a NULL pointer. |
| 163295 | */ |
| 163296 | SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 163297 | if( zFilename==0 || zParam==0 ) return 0; |
| 163298 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163299 | while( zFilename[0] ){ |
| 163300 | int x = strcmp(zFilename, zParam); |
| 163301 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163302 | if( x==0 ) return zFilename; |
| @@ -163308,10 +163344,11 @@ | |
| 163308 | /* |
| 163309 | ** Return a pointer to the name of Nth query parameter of the filename. |
| 163310 | */ |
| 163311 | SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){ |
| 163312 | if( zFilename==0 || N<0 ) return 0; |
| 163313 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163314 | while( zFilename[0] && (N--)>0 ){ |
| 163315 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163316 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163317 | } |
| @@ -163341,29 +163378,10 @@ | |
| 163341 | bDflt = v; |
| 163342 | } |
| 163343 | return bDflt; |
| 163344 | } |
| 163345 | |
| 163346 | /* |
| 163347 | ** The Pager stores the Journal filename, WAL filename, and Database filename |
| 163348 | ** consecutively in memory, in that order, with prefixes \000\001\000, |
| 163349 | ** \002\000, and \003\000, in that order. Thus the three names look like query |
| 163350 | ** parameters if you start at the first prefix. |
| 163351 | ** |
| 163352 | ** This routine backs up a filename to the start of the first prefix. |
| 163353 | ** |
| 163354 | ** This only works if the filenamed passed in was obtained from the Pager. |
| 163355 | */ |
| 163356 | static const char *startOfNameList(const char *zName){ |
| 163357 | while( zName[0]!='\001' || zName[1]!=0 ){ |
| 163358 | zName -= 3; |
| 163359 | while( zName[0]!='\000' ){ zName--; } |
| 163360 | zName++; |
| 163361 | } |
| 163362 | return zName-1; |
| 163363 | } |
| 163364 | |
| 163365 | /* |
| 163366 | ** Translate a filename that was handed to a VFS routine into the corresponding |
| 163367 | ** database, journal, or WAL file. |
| 163368 | ** |
| 163369 | ** It is an error to pass this routine a filename string that was not |
| @@ -163371,18 +163389,30 @@ | |
| 163371 | ** passing free() a pointer that was not obtained from malloc() - it is |
| 163372 | ** an error that we cannot easily detect but that will likely cause memory |
| 163373 | ** corruption. |
| 163374 | */ |
| 163375 | SQLITE_API const char *sqlite3_filename_database(const char *zFilename){ |
| 163376 | return sqlite3_uri_parameter(zFilename - 3, "\003"); |
| 163377 | } |
| 163378 | SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){ |
| 163379 | const char *z = sqlite3_uri_parameter(startOfNameList(zFilename), "\001"); |
| 163380 | return ALWAYS(z) && z[0] ? z : 0; |
| 163381 | } |
| 163382 | SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){ |
| 163383 | return sqlite3_uri_parameter(startOfNameList(zFilename), "\002"); |
| 163384 | } |
| 163385 | |
| 163386 | /* |
| 163387 | ** Return the Btree pointer identified by zDbName. Return NULL if not found. |
| 163388 | */ |
| @@ -219997,12 +220027,12 @@ | |
| 219997 | ** Check if buffer z[], size n bytes, contains as series of valid utf-8 |
| 219998 | ** encoded codepoints. If so, return 0. Otherwise, if the buffer does not |
| 219999 | ** contain valid utf-8, return non-zero. |
| 220000 | */ |
| 220001 | static int fts5TestUtf8(const char *z, int n){ |
| 220002 | assert_nc( n>0 ); |
| 220003 | int i = 0; |
| 220004 | while( i<n ){ |
| 220005 | if( (z[i] & 0x80)==0x00 ){ |
| 220006 | i++; |
| 220007 | }else |
| 220008 | if( (z[i] & 0xE0)==0xC0 ){ |
| @@ -223637,11 +223667,11 @@ | |
| 223637 | int nArg, /* Number of args */ |
| 223638 | sqlite3_value **apUnused /* Function arguments */ |
| 223639 | ){ |
| 223640 | assert( nArg==0 ); |
| 223641 | UNUSED_PARAM2(nArg, apUnused); |
| 223642 | sqlite3_result_text(pCtx, "fts5: 2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824", -1, SQLITE_TRANSIENT); |
| 223643 | } |
| 223644 | |
| 223645 | /* |
| 223646 | ** Return true if zName is the extension on one of the shadow tables used |
| 223647 | ** by this module. |
| @@ -228410,12 +228440,12 @@ | |
| 228410 | } |
| 228411 | #endif /* SQLITE_CORE */ |
| 228412 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 228413 | |
| 228414 | /************** End of stmt.c ************************************************/ |
| 228415 | #if __LINE__!=228415 |
| 228416 | #undef SQLITE_SOURCE_ID |
| 228417 | #define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86alt2" |
| 228418 | #endif |
| 228419 | /* Return the source-id for this library */ |
| 228420 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 228421 | /************************** End of sqlite3.c ******************************/ |
| 228422 |
| --- src/sqlite3.c | |
| +++ src/sqlite3.c | |
| @@ -1,8 +1,8 @@ | |
| 1 | /****************************************************************************** |
| 2 | ** This file is an amalgamation of many separate C source files from SQLite |
| 3 | ** version 3.31.1. By combining all the individual C code files into this |
| 4 | ** single large file, the entire code can be compiled as a single translation |
| 5 | ** unit. This allows many compilers to do optimizations that would not be |
| 6 | ** possible if the files were compiled separately. Performance improvements |
| 7 | ** of 5% or more are commonly seen when SQLite is compiled as a single |
| 8 | ** translation unit. |
| @@ -1163,13 +1163,13 @@ | |
| 1163 | ** |
| 1164 | ** See also: [sqlite3_libversion()], |
| 1165 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 1166 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 1167 | */ |
| 1168 | #define SQLITE_VERSION "3.31.1" |
| 1169 | #define SQLITE_VERSION_NUMBER 3031001 |
| 1170 | #define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e" |
| 1171 | |
| 1172 | /* |
| 1173 | ** CAPI3REF: Run-Time Library Version Numbers |
| 1174 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 1175 | ** |
| @@ -56231,34 +56231,52 @@ | |
| 56231 | ** Pager object (sizeof(Pager) bytes) |
| 56232 | ** PCache object (sqlite3PcacheSize() bytes) |
| 56233 | ** Database file handle (pVfs->szOsFile bytes) |
| 56234 | ** Sub-journal file handle (journalFileSize bytes) |
| 56235 | ** Main journal file handle (journalFileSize bytes) |
| 56236 | ** \0\0\0\0 database prefix (4 bytes) |
| 56237 | ** Database file name (nPathname+1 bytes) |
| 56238 | ** URI query parameters (nUriByte bytes) |
| 56239 | ** Journal filename (nPathname+8+1 bytes) |
| 56240 | ** WAL filename (nPathname+4+1 bytes) |
| 56241 | ** \0\0\0 terminator (3 bytes) |
| 56242 | ** |
| 56243 | ** Some 3rd-party software, over which we have no control, depends on |
| 56244 | ** the specific order of the filenames and the \0 separators between them |
| 56245 | ** so that it can (for example) find the database filename given the WAL |
| 56246 | ** filename without using the sqlite3_filename_database() API. This is a |
| 56247 | ** misuse of SQLite and a bug in the 3rd-party software, but the 3rd-party |
| 56248 | ** software is in widespread use, so we try to avoid changing the filename |
| 56249 | ** order and formatting if possible. In particular, the details of the |
| 56250 | ** filename format expected by 3rd-party software should be as follows: |
| 56251 | ** |
| 56252 | ** - Main Database Path |
| 56253 | ** - \0 |
| 56254 | ** - Multiple URI components consisting of: |
| 56255 | ** - Key |
| 56256 | ** - \0 |
| 56257 | ** - Value |
| 56258 | ** - \0 |
| 56259 | ** - \0 |
| 56260 | ** - Journal Path |
| 56261 | ** - \0 |
| 56262 | ** - WAL Path (zWALName) |
| 56263 | ** - \0 |
| 56264 | */ |
| 56265 | pPtr = (u8 *)sqlite3MallocZero( |
| 56266 | ROUND8(sizeof(*pPager)) + /* Pager structure */ |
| 56267 | ROUND8(pcacheSize) + /* PCache object */ |
| 56268 | ROUND8(pVfs->szOsFile) + /* The main db file */ |
| 56269 | journalFileSize * 2 + /* The two journal files */ |
| 56270 | 4 + /* Database prefix */ |
| 56271 | nPathname + 1 + /* database filename */ |
| 56272 | nUriByte + /* query parameters */ |
| 56273 | nPathname + 8 + 1 + /* Journal filename */ |
| 56274 | #ifndef SQLITE_OMIT_WAL |
| 56275 | nPathname + 4 + 1 + /* WAL filename */ |
| 56276 | #endif |
| 56277 | 3 /* Terminator */ |
| 56278 | ); |
| 56279 | assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) ); |
| 56280 | if( !pPtr ){ |
| 56281 | sqlite3DbFree(0, zPathname); |
| 56282 | return SQLITE_NOMEM_BKPT; |
| @@ -56268,13 +56286,24 @@ | |
| 56286 | pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile); |
| 56287 | pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56288 | pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize; |
| 56289 | assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) ); |
| 56290 | |
| 56291 | /* Fill in the Pager.zFilename and pPager.zQueryParam fields */ |
| 56292 | pPtr += 4; /* Skip zero prefix */ |
| 56293 | pPager->zFilename = (char*)pPtr; |
| 56294 | if( nPathname>0 ){ |
| 56295 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname + 1; |
| 56296 | if( zUri ){ |
| 56297 | memcpy(pPtr, zUri, nUriByte); pPtr += nUriByte; |
| 56298 | }else{ |
| 56299 | pPtr++; |
| 56300 | } |
| 56301 | } |
| 56302 | |
| 56303 | |
| 56304 | /* Fill in Pager.zJournal */ |
| 56305 | if( nPathname>0 ){ |
| 56306 | pPager->zJournal = (char*)pPtr; |
| 56307 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56308 | memcpy(pPtr, "-journal",8); pPtr += 8 + 1; |
| 56309 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56281,16 +56310,14 @@ | |
| 56310 | sqlite3FileSuffix3(zFilename,pPager->zJournal); |
| 56311 | pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1); |
| 56312 | #endif |
| 56313 | }else{ |
| 56314 | pPager->zJournal = 0; |
| 56315 | } |
| 56316 | |
| 56317 | #ifndef SQLITE_OMIT_WAL |
| 56318 | /* Fill in Pager.zWal */ |
| 56319 | if( nPathname>0 ){ |
| 56320 | pPager->zWal = (char*)pPtr; |
| 56321 | memcpy(pPtr, zPathname, nPathname); pPtr += nPathname; |
| 56322 | memcpy(pPtr, "-wal", 4); pPtr += 4 + 1; |
| 56323 | #ifdef SQLITE_ENABLE_8_3_NAMES |
| @@ -56297,25 +56324,13 @@ | |
| 56324 | sqlite3FileSuffix3(zFilename, pPager->zWal); |
| 56325 | pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1); |
| 56326 | #endif |
| 56327 | }else{ |
| 56328 | pPager->zWal = 0; |
| 56329 | } |
| 56330 | #endif |
| 56331 | |
| 56332 | if( nPathname ) sqlite3DbFree(0, zPathname); |
| 56333 | pPager->pVfs = pVfs; |
| 56334 | pPager->vfsFlags = vfsFlags; |
| 56335 | |
| 56336 | /* Open the pager file. |
| @@ -58431,12 +58446,12 @@ | |
| 58446 | ** |
| 58447 | ** The return value to this routine is always safe to use with |
| 58448 | ** sqlite3_uri_parameter() and sqlite3_filename_database() and friends. |
| 58449 | */ |
| 58450 | SQLITE_PRIVATE const char *sqlite3PagerFilename(const Pager *pPager, int nullIfMemDb){ |
| 58451 | static const char zFake[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; |
| 58452 | return (nullIfMemDb && pPager->memDb) ? &zFake[4] : pPager->zFilename; |
| 58453 | } |
| 58454 | |
| 58455 | /* |
| 58456 | ** Return the VFS structure for the pager. |
| 58457 | */ |
| @@ -117489,10 +117504,13 @@ | |
| 117504 | return 0; |
| 117505 | } |
| 117506 | assert( !ExprHasProperty(pExpr, EP_xIsSelect) ); |
| 117507 | nExpr = pExpr->x.pList->nExpr; |
| 117508 | pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, SQLITE_UTF8, 0); |
| 117509 | #ifdef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION |
| 117510 | if( pDef==0 ) return 0; |
| 117511 | #endif |
| 117512 | if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){ |
| 117513 | return 0; |
| 117514 | } |
| 117515 | if( nExpr<3 ){ |
| 117516 | aWc[3] = 0; |
| @@ -121282,16 +121300,18 @@ | |
| 121300 | ** Hence, make a complete copy of the opcode, rather than using |
| 121301 | ** a pointer to the opcode. */ |
| 121302 | x = *sqlite3VdbeGetOp(v, addrConflictCk); |
| 121303 | if( x.opcode!=OP_IdxRowid ){ |
| 121304 | int p2; /* New P2 value for copied conflict check opcode */ |
| 121305 | const char *zP4; |
| 121306 | if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){ |
| 121307 | p2 = lblRecheckOk; |
| 121308 | }else{ |
| 121309 | p2 = x.p2; |
| 121310 | } |
| 121311 | zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z; |
| 121312 | sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, zP4, x.p4type); |
| 121313 | sqlite3VdbeChangeP5(v, x.p5); |
| 121314 | VdbeCoverageIf(v, p2!=x.p2); |
| 121315 | } |
| 121316 | nConflictCk--; |
| 121317 | addrConflictCk++; |
| @@ -122765,15 +122785,15 @@ | |
| 122785 | /* Version 3.25.0 and later */ |
| 122786 | #define sqlite3_create_window_function sqlite3_api->create_window_function |
| 122787 | /* Version 3.26.0 and later */ |
| 122788 | #define sqlite3_normalized_sql sqlite3_api->normalized_sql |
| 122789 | /* Version 3.28.0 and later */ |
| 122790 | #define sqlite3_stmt_isexplain sqlite3_api->stmt_isexplain |
| 122791 | #define sqlite3_value_frombind sqlite3_api->value_frombind |
| 122792 | /* Version 3.30.0 and later */ |
| 122793 | #define sqlite3_drop_modules sqlite3_api->drop_modules |
| 122794 | /* Version 3.31.0 and later */ |
| 122795 | #define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64 |
| 122796 | #define sqlite3_uri_key sqlite3_api->uri_key |
| 122797 | #define sqlite3_filename_database sqlite3_api->filename_database |
| 122798 | #define sqlite3_filename_journal sqlite3_api->filename_journal |
| 122799 | #define sqlite3_filename_wal sqlite3_api->filename_wal |
| @@ -163279,10 +163299,25 @@ | |
| 163299 | } |
| 163300 | va_end(ap); |
| 163301 | #endif /* SQLITE_UNTESTABLE */ |
| 163302 | return rc; |
| 163303 | } |
| 163304 | |
| 163305 | /* |
| 163306 | ** The Pager stores the Database filename, Journal filename, and WAL filename |
| 163307 | ** consecutively in memory, in that order. The database filename is prefixed |
| 163308 | ** by four zero bytes. Locate the start of the database filename by searching |
| 163309 | ** backwards for the first byte following four consecutive zero bytes. |
| 163310 | ** |
| 163311 | ** This only works if the filename passed in was obtained from the Pager. |
| 163312 | */ |
| 163313 | static const char *databaseName(const char *zName){ |
| 163314 | while( zName[-1]!=0 || zName[-2]!=0 || zName[-3]!=0 || zName[-4]!=0 ){ |
| 163315 | zName--; |
| 163316 | } |
| 163317 | return zName; |
| 163318 | } |
| 163319 | |
| 163320 | /* |
| 163321 | ** This is a utility routine, useful to VFS implementations, that checks |
| 163322 | ** to see if a database file was a URI that contained a specific query |
| 163323 | ** parameter, and if so obtains the value of the query parameter. |
| @@ -163293,10 +163328,11 @@ | |
| 163328 | ** parameter if it exists. If the parameter does not exist, this routine |
| 163329 | ** returns a NULL pointer. |
| 163330 | */ |
| 163331 | SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){ |
| 163332 | if( zFilename==0 || zParam==0 ) return 0; |
| 163333 | zFilename = databaseName(zFilename); |
| 163334 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163335 | while( zFilename[0] ){ |
| 163336 | int x = strcmp(zFilename, zParam); |
| 163337 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163338 | if( x==0 ) return zFilename; |
| @@ -163308,10 +163344,11 @@ | |
| 163344 | /* |
| 163345 | ** Return a pointer to the name of Nth query parameter of the filename. |
| 163346 | */ |
| 163347 | SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){ |
| 163348 | if( zFilename==0 || N<0 ) return 0; |
| 163349 | zFilename = databaseName(zFilename); |
| 163350 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163351 | while( zFilename[0] && (N--)>0 ){ |
| 163352 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163353 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163354 | } |
| @@ -163341,29 +163378,10 @@ | |
| 163378 | bDflt = v; |
| 163379 | } |
| 163380 | return bDflt; |
| 163381 | } |
| 163382 | |
| 163383 | /* |
| 163384 | ** Translate a filename that was handed to a VFS routine into the corresponding |
| 163385 | ** database, journal, or WAL file. |
| 163386 | ** |
| 163387 | ** It is an error to pass this routine a filename string that was not |
| @@ -163371,18 +163389,30 @@ | |
| 163389 | ** passing free() a pointer that was not obtained from malloc() - it is |
| 163390 | ** an error that we cannot easily detect but that will likely cause memory |
| 163391 | ** corruption. |
| 163392 | */ |
| 163393 | SQLITE_API const char *sqlite3_filename_database(const char *zFilename){ |
| 163394 | return databaseName(zFilename); |
| 163395 | return sqlite3_uri_parameter(zFilename - 3, "\003"); |
| 163396 | } |
| 163397 | SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){ |
| 163398 | zFilename = databaseName(zFilename); |
| 163399 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163400 | while( zFilename[0] ){ |
| 163401 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163402 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163403 | } |
| 163404 | return zFilename + 1; |
| 163405 | } |
| 163406 | SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){ |
| 163407 | #ifdef SQLITE_OMIT_WAL |
| 163408 | return 0; |
| 163409 | #else |
| 163410 | zFilename = sqlite3_filename_journal(zFilename); |
| 163411 | zFilename += sqlite3Strlen30(zFilename) + 1; |
| 163412 | return zFilename; |
| 163413 | #endif |
| 163414 | } |
| 163415 | |
| 163416 | /* |
| 163417 | ** Return the Btree pointer identified by zDbName. Return NULL if not found. |
| 163418 | */ |
| @@ -219997,12 +220027,12 @@ | |
| 220027 | ** Check if buffer z[], size n bytes, contains as series of valid utf-8 |
| 220028 | ** encoded codepoints. If so, return 0. Otherwise, if the buffer does not |
| 220029 | ** contain valid utf-8, return non-zero. |
| 220030 | */ |
| 220031 | static int fts5TestUtf8(const char *z, int n){ |
| 220032 | int i = 0; |
| 220033 | assert_nc( n>0 ); |
| 220034 | while( i<n ){ |
| 220035 | if( (z[i] & 0x80)==0x00 ){ |
| 220036 | i++; |
| 220037 | }else |
| 220038 | if( (z[i] & 0xE0)==0xC0 ){ |
| @@ -223637,11 +223667,11 @@ | |
| 223667 | int nArg, /* Number of args */ |
| 223668 | sqlite3_value **apUnused /* Function arguments */ |
| 223669 | ){ |
| 223670 | assert( nArg==0 ); |
| 223671 | UNUSED_PARAM2(nArg, apUnused); |
| 223672 | sqlite3_result_text(pCtx, "fts5: 2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e", -1, SQLITE_TRANSIENT); |
| 223673 | } |
| 223674 | |
| 223675 | /* |
| 223676 | ** Return true if zName is the extension on one of the shadow tables used |
| 223677 | ** by this module. |
| @@ -228410,12 +228440,12 @@ | |
| 228440 | } |
| 228441 | #endif /* SQLITE_CORE */ |
| 228442 | #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */ |
| 228443 | |
| 228444 | /************** End of stmt.c ************************************************/ |
| 228445 | #if __LINE__!=228445 |
| 228446 | #undef SQLITE_SOURCE_ID |
| 228447 | #define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563alt2" |
| 228448 | #endif |
| 228449 | /* Return the source-id for this library */ |
| 228450 | SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; } |
| 228451 | /************************** End of sqlite3.c ******************************/ |
| 228452 |
+3
-3
| --- src/sqlite3.h | ||
| +++ src/sqlite3.h | ||
| @@ -121,13 +121,13 @@ | ||
| 121 | 121 | ** |
| 122 | 122 | ** See also: [sqlite3_libversion()], |
| 123 | 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | 125 | */ |
| 126 | -#define SQLITE_VERSION "3.31.0" | |
| 127 | -#define SQLITE_VERSION_NUMBER 3031000 | |
| 128 | -#define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" | |
| 126 | +#define SQLITE_VERSION "3.31.1" | |
| 127 | +#define SQLITE_VERSION_NUMBER 3031001 | |
| 128 | +#define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e" | |
| 129 | 129 | |
| 130 | 130 | /* |
| 131 | 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | 133 | ** |
| 134 | 134 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,13 +121,13 @@ | |
| 121 | ** |
| 122 | ** See also: [sqlite3_libversion()], |
| 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | */ |
| 126 | #define SQLITE_VERSION "3.31.0" |
| 127 | #define SQLITE_VERSION_NUMBER 3031000 |
| 128 | #define SQLITE_SOURCE_ID "2020-01-22 18:38:59 f6affdd41608946fcfcea914ece149038a8b25a62bbe719ed2561c649b86d824" |
| 129 | |
| 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | ** |
| 134 |
| --- src/sqlite3.h | |
| +++ src/sqlite3.h | |
| @@ -121,13 +121,13 @@ | |
| 121 | ** |
| 122 | ** See also: [sqlite3_libversion()], |
| 123 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 124 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 125 | */ |
| 126 | #define SQLITE_VERSION "3.31.1" |
| 127 | #define SQLITE_VERSION_NUMBER 3031001 |
| 128 | #define SQLITE_SOURCE_ID "2020-01-28 15:02:23 04885763c4cd00cbca26d048f2b19316bfc93e8edebeceaa171ebfc6c563d53e" |
| 129 | |
| 130 | /* |
| 131 | ** CAPI3REF: Run-Time Library Version Numbers |
| 132 | ** KEYWORDS: sqlite3_version sqlite3_sourceid |
| 133 | ** |
| 134 |