Fossil SCM

Update the built-in SQLite to version 3.31.1 plus the s390x architecture fix.

drh 2020-01-28 15:21 trunk
Commit e8f24f7ecdc1707d8b66cee982d00ddece8d6d6bf9582b567992da0e8c443200
2 files changed +93 -63 +3 -3
+93 -63
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
** 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
44
** single large file, the entire code can be compiled as a single translation
55
** unit. This allows many compilers to do optimizations that would not be
66
** possible if the files were compiled separately. Performance improvements
77
** of 5% or more are commonly seen when SQLite is compiled as a single
88
** translation unit.
@@ -1163,13 +1163,13 @@
11631163
**
11641164
** See also: [sqlite3_libversion()],
11651165
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11661166
** [sqlite_version()] and [sqlite_source_id()].
11671167
*/
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"
11711171
11721172
/*
11731173
** CAPI3REF: Run-Time Library Version Numbers
11741174
** KEYWORDS: sqlite3_version sqlite3_sourceid
11751175
**
@@ -56231,34 +56231,52 @@
5623156231
** Pager object (sizeof(Pager) bytes)
5623256232
** PCache object (sqlite3PcacheSize() bytes)
5623356233
** Database file handle (pVfs->szOsFile bytes)
5623456234
** Sub-journal file handle (journalFileSize bytes)
5623556235
** 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)
5624156237
** Database file name (nPathname+1 bytes)
5624256238
** 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
5624456264
*/
5624556265
pPtr = (u8 *)sqlite3MallocZero(
5624656266
ROUND8(sizeof(*pPager)) + /* Pager structure */
5624756267
ROUND8(pcacheSize) + /* PCache object */
5624856268
ROUND8(pVfs->szOsFile) + /* The main db file */
5624956269
journalFileSize * 2 + /* The two journal files */
56250
- 3 + /* Journal prefix */
56270
+ 4 + /* Database prefix */
56271
+ nPathname + 1 + /* database filename */
56272
+ nUriByte + /* query parameters */
5625156273
nPathname + 8 + 1 + /* Journal filename */
5625256274
#ifndef SQLITE_OMIT_WAL
56253
- 2 + /* WAL prefix */
5625456275
nPathname + 4 + 1 + /* WAL filename */
5625556276
#endif
56256
- 2 + /* Database prefix */
56257
- nPathname + 1 + /* database filename */
56258
- nUriByte + /* query parameters */
56259
- 2 /* Terminator */
56277
+ 3 /* Terminator */
5626056278
);
5626156279
assert( EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize)) );
5626256280
if( !pPtr ){
5626356281
sqlite3DbFree(0, zPathname);
5626456282
return SQLITE_NOMEM_BKPT;
@@ -56268,13 +56286,24 @@
5626856286
pPager->fd = (sqlite3_file*)pPtr; pPtr += ROUND8(pVfs->szOsFile);
5626956287
pPager->sjfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
5627056288
pPager->jfd = (sqlite3_file*)pPtr; pPtr += journalFileSize;
5627156289
assert( EIGHT_BYTE_ALIGNMENT(pPager->jfd) );
5627256290
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
+
5627356303
5627456304
/* Fill in Pager.zJournal */
56275
- pPtr[1] = '\001'; pPtr += 3;
5627656305
if( nPathname>0 ){
5627756306
pPager->zJournal = (char*)pPtr;
5627856307
memcpy(pPtr, zPathname, nPathname); pPtr += nPathname;
5627956308
memcpy(pPtr, "-journal",8); pPtr += 8 + 1;
5628056309
#ifdef SQLITE_ENABLE_8_3_NAMES
@@ -56281,16 +56310,14 @@
5628156310
sqlite3FileSuffix3(zFilename,pPager->zJournal);
5628256311
pPtr = (u8*)(pPager->zJournal + sqlite3Strlen30(pPager->zJournal)+1);
5628356312
#endif
5628456313
}else{
5628556314
pPager->zJournal = 0;
56286
- pPtr++;
5628756315
}
5628856316
5628956317
#ifndef SQLITE_OMIT_WAL
5629056318
/* Fill in Pager.zWal */
56291
- pPtr[0] = '\002'; pPtr[1] = 0; pPtr += 2;
5629256319
if( nPathname>0 ){
5629356320
pPager->zWal = (char*)pPtr;
5629456321
memcpy(pPtr, zPathname, nPathname); pPtr += nPathname;
5629556322
memcpy(pPtr, "-wal", 4); pPtr += 4 + 1;
5629656323
#ifdef SQLITE_ENABLE_8_3_NAMES
@@ -56297,25 +56324,13 @@
5629756324
sqlite3FileSuffix3(zFilename, pPager->zWal);
5629856325
pPtr = (u8*)(pPager->zWal + sqlite3Strlen30(pPager->zWal)+1);
5629956326
#endif
5630056327
}else{
5630156328
pPager->zWal = 0;
56302
- pPtr++;
5630356329
}
5630456330
#endif
5630556331
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
-
5631756332
if( nPathname ) sqlite3DbFree(0, zPathname);
5631856333
pPager->pVfs = pVfs;
5631956334
pPager->vfsFlags = vfsFlags;
5632056335
5632156336
/* Open the pager file.
@@ -58431,12 +58446,12 @@
5843158446
**
5843258447
** The return value to this routine is always safe to use with
5843358448
** sqlite3_uri_parameter() and sqlite3_filename_database() and friends.
5843458449
*/
5843558450
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;
5843858453
}
5843958454
5844058455
/*
5844158456
** Return the VFS structure for the pager.
5844258457
*/
@@ -117489,10 +117504,13 @@
117489117504
return 0;
117490117505
}
117491117506
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
117492117507
nExpr = pExpr->x.pList->nExpr;
117493117508
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
117494117512
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_FUNC_LIKE)==0 ){
117495117513
return 0;
117496117514
}
117497117515
if( nExpr<3 ){
117498117516
aWc[3] = 0;
@@ -121282,16 +121300,18 @@
121282121300
** Hence, make a complete copy of the opcode, rather than using
121283121301
** a pointer to the opcode. */
121284121302
x = *sqlite3VdbeGetOp(v, addrConflictCk);
121285121303
if( x.opcode!=OP_IdxRowid ){
121286121304
int p2; /* New P2 value for copied conflict check opcode */
121305
+ const char *zP4;
121287121306
if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){
121288121307
p2 = lblRecheckOk;
121289121308
}else{
121290121309
p2 = x.p2;
121291121310
}
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);
121293121313
sqlite3VdbeChangeP5(v, x.p5);
121294121314
VdbeCoverageIf(v, p2!=x.p2);
121295121315
}
121296121316
nConflictCk--;
121297121317
addrConflictCk++;
@@ -122765,15 +122785,15 @@
122765122785
/* Version 3.25.0 and later */
122766122786
#define sqlite3_create_window_function sqlite3_api->create_window_function
122767122787
/* Version 3.26.0 and later */
122768122788
#define sqlite3_normalized_sql sqlite3_api->normalized_sql
122769122789
/* 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
122772122792
/* Version 3.30.0 and later */
122773122793
#define sqlite3_drop_modules sqlite3_api->drop_modules
122774
-/* Version 3.31.0 andn later */
122794
+/* Version 3.31.0 and later */
122775122795
#define sqlite3_hard_heap_limit64 sqlite3_api->hard_heap_limit64
122776122796
#define sqlite3_uri_key sqlite3_api->uri_key
122777122797
#define sqlite3_filename_database sqlite3_api->filename_database
122778122798
#define sqlite3_filename_journal sqlite3_api->filename_journal
122779122799
#define sqlite3_filename_wal sqlite3_api->filename_wal
@@ -163279,10 +163299,25 @@
163279163299
}
163280163300
va_end(ap);
163281163301
#endif /* SQLITE_UNTESTABLE */
163282163302
return rc;
163283163303
}
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
+}
163284163319
163285163320
/*
163286163321
** This is a utility routine, useful to VFS implementations, that checks
163287163322
** to see if a database file was a URI that contained a specific query
163288163323
** parameter, and if so obtains the value of the query parameter.
@@ -163293,10 +163328,11 @@
163293163328
** parameter if it exists. If the parameter does not exist, this routine
163294163329
** returns a NULL pointer.
163295163330
*/
163296163331
SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam){
163297163332
if( zFilename==0 || zParam==0 ) return 0;
163333
+ zFilename = databaseName(zFilename);
163298163334
zFilename += sqlite3Strlen30(zFilename) + 1;
163299163335
while( zFilename[0] ){
163300163336
int x = strcmp(zFilename, zParam);
163301163337
zFilename += sqlite3Strlen30(zFilename) + 1;
163302163338
if( x==0 ) return zFilename;
@@ -163308,10 +163344,11 @@
163308163344
/*
163309163345
** Return a pointer to the name of Nth query parameter of the filename.
163310163346
*/
163311163347
SQLITE_API const char *sqlite3_uri_key(const char *zFilename, int N){
163312163348
if( zFilename==0 || N<0 ) return 0;
163349
+ zFilename = databaseName(zFilename);
163313163350
zFilename += sqlite3Strlen30(zFilename) + 1;
163314163351
while( zFilename[0] && (N--)>0 ){
163315163352
zFilename += sqlite3Strlen30(zFilename) + 1;
163316163353
zFilename += sqlite3Strlen30(zFilename) + 1;
163317163354
}
@@ -163341,29 +163378,10 @@
163341163378
bDflt = v;
163342163379
}
163343163380
return bDflt;
163344163381
}
163345163382
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
-
163365163383
/*
163366163384
** Translate a filename that was handed to a VFS routine into the corresponding
163367163385
** database, journal, or WAL file.
163368163386
**
163369163387
** It is an error to pass this routine a filename string that was not
@@ -163371,18 +163389,30 @@
163371163389
** passing free() a pointer that was not obtained from malloc() - it is
163372163390
** an error that we cannot easily detect but that will likely cause memory
163373163391
** corruption.
163374163392
*/
163375163393
SQLITE_API const char *sqlite3_filename_database(const char *zFilename){
163394
+ return databaseName(zFilename);
163376163395
return sqlite3_uri_parameter(zFilename - 3, "\003");
163377163396
}
163378163397
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;
163381163405
}
163382163406
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
163384163414
}
163385163415
163386163416
/*
163387163417
** Return the Btree pointer identified by zDbName. Return NULL if not found.
163388163418
*/
@@ -219997,12 +220027,12 @@
219997220027
** Check if buffer z[], size n bytes, contains as series of valid utf-8
219998220028
** encoded codepoints. If so, return 0. Otherwise, if the buffer does not
219999220029
** contain valid utf-8, return non-zero.
220000220030
*/
220001220031
static int fts5TestUtf8(const char *z, int n){
220002
- assert_nc( n>0 );
220003220032
int i = 0;
220033
+ assert_nc( n>0 );
220004220034
while( i<n ){
220005220035
if( (z[i] & 0x80)==0x00 ){
220006220036
i++;
220007220037
}else
220008220038
if( (z[i] & 0xE0)==0xC0 ){
@@ -223637,11 +223667,11 @@
223637223667
int nArg, /* Number of args */
223638223668
sqlite3_value **apUnused /* Function arguments */
223639223669
){
223640223670
assert( nArg==0 );
223641223671
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);
223643223673
}
223644223674
223645223675
/*
223646223676
** Return true if zName is the extension on one of the shadow tables used
223647223677
** by this module.
@@ -228410,12 +228440,12 @@
228410228440
}
228411228441
#endif /* SQLITE_CORE */
228412228442
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
228413228443
228414228444
/************** End of stmt.c ************************************************/
228415
-#if __LINE__!=228415
228445
+#if __LINE__!=228445
228416228446
#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"
228418228448
#endif
228419228449
/* Return the source-id for this library */
228420228450
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
228421228451
/************************** End of sqlite3.c ******************************/
228422228452
--- 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 @@
121121
**
122122
** See also: [sqlite3_libversion()],
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
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"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
134134
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button