Fossil SCM

Update the built-in SQLite to the official 3.34.0 release.

drh 2020-12-01 16:42 trunk
Commit 5434159a382255a2443ed0b4c8cbed3cd0865f1e912a119fb26bc86151d4ff36
3 files changed +26 -9 +44 -27 +4 -4
+26 -9
--- src/shell.c
+++ src/shell.c
@@ -5420,14 +5420,14 @@
54205420
** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
54215421
** result set of queries against generate_series will look like.
54225422
*/
54235423
static int seriesConnect(
54245424
sqlite3 *db,
5425
- void *pAux,
5426
- int argc, const char *const*argv,
5425
+ void *pUnused,
5426
+ int argcUnused, const char *const*argvUnused,
54275427
sqlite3_vtab **ppVtab,
5428
- char **pzErr
5428
+ char **pzErrUnused
54295429
){
54305430
sqlite3_vtab *pNew;
54315431
int rc;
54325432
54335433
/* Column numbers */
@@ -5434,10 +5434,14 @@
54345434
#define SERIES_COLUMN_VALUE 0
54355435
#define SERIES_COLUMN_START 1
54365436
#define SERIES_COLUMN_STOP 2
54375437
#define SERIES_COLUMN_STEP 3
54385438
5439
+ (void)pUnused;
5440
+ (void)argcUnused;
5441
+ (void)argvUnused;
5442
+ (void)pzErrUnused;
54395443
rc = sqlite3_declare_vtab(db,
54405444
"CREATE TABLE x(value,start hidden,stop hidden,step hidden)");
54415445
if( rc==SQLITE_OK ){
54425446
pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) );
54435447
if( pNew==0 ) return SQLITE_NOMEM;
@@ -5456,12 +5460,13 @@
54565460
}
54575461
54585462
/*
54595463
** Constructor for a new series_cursor object.
54605464
*/
5461
-static int seriesOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
5465
+static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){
54625466
series_cursor *pCur;
5467
+ (void)pUnused;
54635468
pCur = sqlite3_malloc( sizeof(*pCur) );
54645469
if( pCur==0 ) return SQLITE_NOMEM;
54655470
memset(pCur, 0, sizeof(*pCur));
54665471
*ppCursor = &pCur->base;
54675472
return SQLITE_OK;
@@ -5564,15 +5569,16 @@
55645569
** is pointing at the first row, or pointing off the end of the table
55655570
** (so that seriesEof() will return true) if the table is empty.
55665571
*/
55675572
static int seriesFilter(
55685573
sqlite3_vtab_cursor *pVtabCursor,
5569
- int idxNum, const char *idxStr,
5574
+ int idxNum, const char *idxStrUnused,
55705575
int argc, sqlite3_value **argv
55715576
){
55725577
series_cursor *pCur = (series_cursor *)pVtabCursor;
55735578
int i = 0;
5579
+ (void)idxStrUnused;
55745580
if( idxNum & 1 ){
55755581
pCur->mnValue = sqlite3_value_int64(argv[i++]);
55765582
}else{
55775583
pCur->mnValue = 0;
55785584
}
@@ -5625,11 +5631,11 @@
56255631
** (2) stop = $value -- constraint exists
56265632
** (4) step = $value -- constraint exists
56275633
** (8) output in descending order
56285634
*/
56295635
static int seriesBestIndex(
5630
- sqlite3_vtab *tab,
5636
+ sqlite3_vtab *tabUnused,
56315637
sqlite3_index_info *pIdxInfo
56325638
){
56335639
int i, j; /* Loop over constraints */
56345640
int idxNum = 0; /* The query plan bitmask */
56355641
int unusableMask = 0; /* Mask of unusable constraints */
@@ -5639,10 +5645,11 @@
56395645
56405646
/* This implementation assumes that the start, stop, and step columns
56415647
** are the last three columns in the virtual table. */
56425648
assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 );
56435649
assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 );
5650
+ (void)tabUnused;
56445651
aIdx[0] = aIdx[1] = aIdx[2] = -1;
56455652
pConstraint = pIdxInfo->aConstraint;
56465653
for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
56475654
int iCol; /* 0 for start, 1 for stop, 2 for step */
56485655
int iMask; /* bitmask for those column */
@@ -5712,10 +5719,14 @@
57125719
0, /* xSync */
57135720
0, /* xCommit */
57145721
0, /* xRollback */
57155722
0, /* xFindMethod */
57165723
0, /* xRename */
5724
+ 0, /* xSavepoint */
5725
+ 0, /* xRelease */
5726
+ 0, /* xRollbackTo */
5727
+ 0 /* xShadowName */
57175728
};
57185729
57195730
#endif /* SQLITE_OMIT_VIRTUALTABLE */
57205731
57215732
#ifdef _WIN32
@@ -14455,14 +14466,15 @@
1445514466
/*
1445614467
** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X.
1445714468
*/
1445814469
static void shellUSleepFunc(
1445914470
sqlite3_context *context,
14460
- int argc,
14471
+ int argcUnused,
1446114472
sqlite3_value **argv
1446214473
){
1446314474
int sleep = sqlite3_value_int(argv[0]);
14475
+ (void)argcUnused;
1446414476
sqlite3_sleep(sleep/1000);
1446514477
sqlite3_result_int(context, sleep);
1446614478
}
1446714479
1446814480
/*
@@ -20657,12 +20669,15 @@
2065720669
p->in = fopen(sqliterc,"rb");
2065820670
if( p->in ){
2065920671
if( stdin_is_interactive ){
2066020672
utf8_printf(stderr,"-- Loading resources from %s\n",sqliterc);
2066120673
}
20662
- process_input(p);
20674
+ if( process_input(p) && bail_on_error ) exit(1);
2066320675
fclose(p->in);
20676
+ }else if( sqliterc_override!=0 ){
20677
+ utf8_printf(stderr,"cannot open: \"%s\"\n", sqliterc);
20678
+ if( bail_on_error ) exit(1);
2066420679
}
2066520680
p->in = inSaved;
2066620681
p->lineno = savedLineno;
2066720682
sqlite3_free(zBuf);
2066820683
}
@@ -21044,10 +21059,12 @@
2104421059
** command, so ignore them */
2104521060
break;
2104621061
#endif
2104721062
}else if( strcmp(z, "-memtrace")==0 ){
2104821063
sqlite3MemTraceActivate(stderr);
21064
+ }else if( strcmp(z,"-bail")==0 ){
21065
+ bail_on_error = 1;
2104921066
}
2105021067
}
2105121068
verify_uninitialized();
2105221069
2105321070
@@ -21190,11 +21207,11 @@
2119021207
** prior to sending the SQL into SQLite. Useful for injecting
2119121208
** crazy bytes in the middle of SQL statements for testing and debugging.
2119221209
*/
2119321210
ShellSetFlag(&data, SHFLG_Backslash);
2119421211
}else if( strcmp(z,"-bail")==0 ){
21195
- bail_on_error = 1;
21212
+ /* No-op. The bail_on_error flag should already be set. */
2119621213
}else if( strcmp(z,"-version")==0 ){
2119721214
printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
2119821215
return 0;
2119921216
}else if( strcmp(z,"-interactive")==0 ){
2120021217
stdin_is_interactive = 1;
2120121218
--- src/shell.c
+++ src/shell.c
@@ -5420,14 +5420,14 @@
5420 ** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
5421 ** result set of queries against generate_series will look like.
5422 */
5423 static int seriesConnect(
5424 sqlite3 *db,
5425 void *pAux,
5426 int argc, const char *const*argv,
5427 sqlite3_vtab **ppVtab,
5428 char **pzErr
5429 ){
5430 sqlite3_vtab *pNew;
5431 int rc;
5432
5433 /* Column numbers */
@@ -5434,10 +5434,14 @@
5434 #define SERIES_COLUMN_VALUE 0
5435 #define SERIES_COLUMN_START 1
5436 #define SERIES_COLUMN_STOP 2
5437 #define SERIES_COLUMN_STEP 3
5438
 
 
 
 
5439 rc = sqlite3_declare_vtab(db,
5440 "CREATE TABLE x(value,start hidden,stop hidden,step hidden)");
5441 if( rc==SQLITE_OK ){
5442 pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) );
5443 if( pNew==0 ) return SQLITE_NOMEM;
@@ -5456,12 +5460,13 @@
5456 }
5457
5458 /*
5459 ** Constructor for a new series_cursor object.
5460 */
5461 static int seriesOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
5462 series_cursor *pCur;
 
5463 pCur = sqlite3_malloc( sizeof(*pCur) );
5464 if( pCur==0 ) return SQLITE_NOMEM;
5465 memset(pCur, 0, sizeof(*pCur));
5466 *ppCursor = &pCur->base;
5467 return SQLITE_OK;
@@ -5564,15 +5569,16 @@
5564 ** is pointing at the first row, or pointing off the end of the table
5565 ** (so that seriesEof() will return true) if the table is empty.
5566 */
5567 static int seriesFilter(
5568 sqlite3_vtab_cursor *pVtabCursor,
5569 int idxNum, const char *idxStr,
5570 int argc, sqlite3_value **argv
5571 ){
5572 series_cursor *pCur = (series_cursor *)pVtabCursor;
5573 int i = 0;
 
5574 if( idxNum & 1 ){
5575 pCur->mnValue = sqlite3_value_int64(argv[i++]);
5576 }else{
5577 pCur->mnValue = 0;
5578 }
@@ -5625,11 +5631,11 @@
5625 ** (2) stop = $value -- constraint exists
5626 ** (4) step = $value -- constraint exists
5627 ** (8) output in descending order
5628 */
5629 static int seriesBestIndex(
5630 sqlite3_vtab *tab,
5631 sqlite3_index_info *pIdxInfo
5632 ){
5633 int i, j; /* Loop over constraints */
5634 int idxNum = 0; /* The query plan bitmask */
5635 int unusableMask = 0; /* Mask of unusable constraints */
@@ -5639,10 +5645,11 @@
5639
5640 /* This implementation assumes that the start, stop, and step columns
5641 ** are the last three columns in the virtual table. */
5642 assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 );
5643 assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 );
 
5644 aIdx[0] = aIdx[1] = aIdx[2] = -1;
5645 pConstraint = pIdxInfo->aConstraint;
5646 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
5647 int iCol; /* 0 for start, 1 for stop, 2 for step */
5648 int iMask; /* bitmask for those column */
@@ -5712,10 +5719,14 @@
5712 0, /* xSync */
5713 0, /* xCommit */
5714 0, /* xRollback */
5715 0, /* xFindMethod */
5716 0, /* xRename */
 
 
 
 
5717 };
5718
5719 #endif /* SQLITE_OMIT_VIRTUALTABLE */
5720
5721 #ifdef _WIN32
@@ -14455,14 +14466,15 @@
14455 /*
14456 ** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X.
14457 */
14458 static void shellUSleepFunc(
14459 sqlite3_context *context,
14460 int argc,
14461 sqlite3_value **argv
14462 ){
14463 int sleep = sqlite3_value_int(argv[0]);
 
14464 sqlite3_sleep(sleep/1000);
14465 sqlite3_result_int(context, sleep);
14466 }
14467
14468 /*
@@ -20657,12 +20669,15 @@
20657 p->in = fopen(sqliterc,"rb");
20658 if( p->in ){
20659 if( stdin_is_interactive ){
20660 utf8_printf(stderr,"-- Loading resources from %s\n",sqliterc);
20661 }
20662 process_input(p);
20663 fclose(p->in);
 
 
 
20664 }
20665 p->in = inSaved;
20666 p->lineno = savedLineno;
20667 sqlite3_free(zBuf);
20668 }
@@ -21044,10 +21059,12 @@
21044 ** command, so ignore them */
21045 break;
21046 #endif
21047 }else if( strcmp(z, "-memtrace")==0 ){
21048 sqlite3MemTraceActivate(stderr);
 
 
21049 }
21050 }
21051 verify_uninitialized();
21052
21053
@@ -21190,11 +21207,11 @@
21190 ** prior to sending the SQL into SQLite. Useful for injecting
21191 ** crazy bytes in the middle of SQL statements for testing and debugging.
21192 */
21193 ShellSetFlag(&data, SHFLG_Backslash);
21194 }else if( strcmp(z,"-bail")==0 ){
21195 bail_on_error = 1;
21196 }else if( strcmp(z,"-version")==0 ){
21197 printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
21198 return 0;
21199 }else if( strcmp(z,"-interactive")==0 ){
21200 stdin_is_interactive = 1;
21201
--- src/shell.c
+++ src/shell.c
@@ -5420,14 +5420,14 @@
5420 ** (2) Tell SQLite (via the sqlite3_declare_vtab() interface) what the
5421 ** result set of queries against generate_series will look like.
5422 */
5423 static int seriesConnect(
5424 sqlite3 *db,
5425 void *pUnused,
5426 int argcUnused, const char *const*argvUnused,
5427 sqlite3_vtab **ppVtab,
5428 char **pzErrUnused
5429 ){
5430 sqlite3_vtab *pNew;
5431 int rc;
5432
5433 /* Column numbers */
@@ -5434,10 +5434,14 @@
5434 #define SERIES_COLUMN_VALUE 0
5435 #define SERIES_COLUMN_START 1
5436 #define SERIES_COLUMN_STOP 2
5437 #define SERIES_COLUMN_STEP 3
5438
5439 (void)pUnused;
5440 (void)argcUnused;
5441 (void)argvUnused;
5442 (void)pzErrUnused;
5443 rc = sqlite3_declare_vtab(db,
5444 "CREATE TABLE x(value,start hidden,stop hidden,step hidden)");
5445 if( rc==SQLITE_OK ){
5446 pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) );
5447 if( pNew==0 ) return SQLITE_NOMEM;
@@ -5456,12 +5460,13 @@
5460 }
5461
5462 /*
5463 ** Constructor for a new series_cursor object.
5464 */
5465 static int seriesOpen(sqlite3_vtab *pUnused, sqlite3_vtab_cursor **ppCursor){
5466 series_cursor *pCur;
5467 (void)pUnused;
5468 pCur = sqlite3_malloc( sizeof(*pCur) );
5469 if( pCur==0 ) return SQLITE_NOMEM;
5470 memset(pCur, 0, sizeof(*pCur));
5471 *ppCursor = &pCur->base;
5472 return SQLITE_OK;
@@ -5564,15 +5569,16 @@
5569 ** is pointing at the first row, or pointing off the end of the table
5570 ** (so that seriesEof() will return true) if the table is empty.
5571 */
5572 static int seriesFilter(
5573 sqlite3_vtab_cursor *pVtabCursor,
5574 int idxNum, const char *idxStrUnused,
5575 int argc, sqlite3_value **argv
5576 ){
5577 series_cursor *pCur = (series_cursor *)pVtabCursor;
5578 int i = 0;
5579 (void)idxStrUnused;
5580 if( idxNum & 1 ){
5581 pCur->mnValue = sqlite3_value_int64(argv[i++]);
5582 }else{
5583 pCur->mnValue = 0;
5584 }
@@ -5625,11 +5631,11 @@
5631 ** (2) stop = $value -- constraint exists
5632 ** (4) step = $value -- constraint exists
5633 ** (8) output in descending order
5634 */
5635 static int seriesBestIndex(
5636 sqlite3_vtab *tabUnused,
5637 sqlite3_index_info *pIdxInfo
5638 ){
5639 int i, j; /* Loop over constraints */
5640 int idxNum = 0; /* The query plan bitmask */
5641 int unusableMask = 0; /* Mask of unusable constraints */
@@ -5639,10 +5645,11 @@
5645
5646 /* This implementation assumes that the start, stop, and step columns
5647 ** are the last three columns in the virtual table. */
5648 assert( SERIES_COLUMN_STOP == SERIES_COLUMN_START+1 );
5649 assert( SERIES_COLUMN_STEP == SERIES_COLUMN_START+2 );
5650 (void)tabUnused;
5651 aIdx[0] = aIdx[1] = aIdx[2] = -1;
5652 pConstraint = pIdxInfo->aConstraint;
5653 for(i=0; i<pIdxInfo->nConstraint; i++, pConstraint++){
5654 int iCol; /* 0 for start, 1 for stop, 2 for step */
5655 int iMask; /* bitmask for those column */
@@ -5712,10 +5719,14 @@
5719 0, /* xSync */
5720 0, /* xCommit */
5721 0, /* xRollback */
5722 0, /* xFindMethod */
5723 0, /* xRename */
5724 0, /* xSavepoint */
5725 0, /* xRelease */
5726 0, /* xRollbackTo */
5727 0 /* xShadowName */
5728 };
5729
5730 #endif /* SQLITE_OMIT_VIRTUALTABLE */
5731
5732 #ifdef _WIN32
@@ -14455,14 +14466,15 @@
14466 /*
14467 ** Scalar function "usleep(X)" invokes sqlite3_sleep(X) and returns X.
14468 */
14469 static void shellUSleepFunc(
14470 sqlite3_context *context,
14471 int argcUnused,
14472 sqlite3_value **argv
14473 ){
14474 int sleep = sqlite3_value_int(argv[0]);
14475 (void)argcUnused;
14476 sqlite3_sleep(sleep/1000);
14477 sqlite3_result_int(context, sleep);
14478 }
14479
14480 /*
@@ -20657,12 +20669,15 @@
20669 p->in = fopen(sqliterc,"rb");
20670 if( p->in ){
20671 if( stdin_is_interactive ){
20672 utf8_printf(stderr,"-- Loading resources from %s\n",sqliterc);
20673 }
20674 if( process_input(p) && bail_on_error ) exit(1);
20675 fclose(p->in);
20676 }else if( sqliterc_override!=0 ){
20677 utf8_printf(stderr,"cannot open: \"%s\"\n", sqliterc);
20678 if( bail_on_error ) exit(1);
20679 }
20680 p->in = inSaved;
20681 p->lineno = savedLineno;
20682 sqlite3_free(zBuf);
20683 }
@@ -21044,10 +21059,12 @@
21059 ** command, so ignore them */
21060 break;
21061 #endif
21062 }else if( strcmp(z, "-memtrace")==0 ){
21063 sqlite3MemTraceActivate(stderr);
21064 }else if( strcmp(z,"-bail")==0 ){
21065 bail_on_error = 1;
21066 }
21067 }
21068 verify_uninitialized();
21069
21070
@@ -21190,11 +21207,11 @@
21207 ** prior to sending the SQL into SQLite. Useful for injecting
21208 ** crazy bytes in the middle of SQL statements for testing and debugging.
21209 */
21210 ShellSetFlag(&data, SHFLG_Backslash);
21211 }else if( strcmp(z,"-bail")==0 ){
21212 /* No-op. The bail_on_error flag should already be set. */
21213 }else if( strcmp(z,"-version")==0 ){
21214 printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid());
21215 return 0;
21216 }else if( strcmp(z,"-interactive")==0 ){
21217 stdin_is_interactive = 1;
21218
+44 -27
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
11711171
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
11721172
** [sqlite_version()] and [sqlite_source_id()].
11731173
*/
11741174
#define SQLITE_VERSION "3.34.0"
11751175
#define SQLITE_VERSION_NUMBER 3034000
1176
-#define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020"
1176
+#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
11771177
11781178
/*
11791179
** CAPI3REF: Run-Time Library Version Numbers
11801180
** KEYWORDS: sqlite3_version sqlite3_sourceid
11811181
**
@@ -7239,11 +7239,11 @@
72397239
** CAPI3REF: Determine the transaction state of a database
72407240
** METHOD: sqlite3
72417241
**
72427242
** ^The sqlite3_txn_state(D,S) interface returns the current
72437243
** [transaction state] of schema S in database connection D. ^If S is NULL,
7244
-** then the highest transaction state of any schema on databse connection D
7244
+** then the highest transaction state of any schema on database connection D
72457245
** is returned. Transaction states are (in order of lowest to highest):
72467246
** <ol>
72477247
** <li value="0"> SQLITE_TXN_NONE
72487248
** <li value="1"> SQLITE_TXN_READ
72497249
** <li value="2"> SQLITE_TXN_WRITE
@@ -8786,11 +8786,10 @@
87868786
*/
87878787
#define SQLITE_TESTCTRL_FIRST 5
87888788
#define SQLITE_TESTCTRL_PRNG_SAVE 5
87898789
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
87908790
#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
8791
-#define SQLITE_TESTCTRL_SEEK_COUNT 7
87928791
#define SQLITE_TESTCTRL_BITVEC_TEST 8
87938792
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
87948793
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
87958794
#define SQLITE_TESTCTRL_PENDING_BYTE 11
87968795
#define SQLITE_TESTCTRL_ASSERT 12
@@ -8811,11 +8810,12 @@
88118810
#define SQLITE_TESTCTRL_IMPOSTER 25
88128811
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
88138812
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
88148813
#define SQLITE_TESTCTRL_PRNG_SEED 28
88158814
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
8816
-#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
8815
+#define SQLITE_TESTCTRL_SEEK_COUNT 30
8816
+#define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
88178817
88188818
/*
88198819
** CAPI3REF: SQL Keyword Checking
88208820
**
88218821
** These routines provide access to the set of SQL language keywords
@@ -54402,10 +54402,11 @@
5440254402
sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
5440354403
char *zSuperJournal = 0; /* Contents of super-journal file */
5440454404
i64 nSuperJournal; /* Size of super-journal file */
5440554405
char *zJournal; /* Pointer to one journal within MJ file */
5440654406
char *zSuperPtr; /* Space to hold super-journal filename */
54407
+ char *zFree = 0; /* Free this buffer */
5440754408
int nSuperPtr; /* Amount of space allocated to zSuperPtr[] */
5440854409
5440954410
/* Allocate space for both the pJournal and pSuper file descriptors.
5441054411
** If successful, open the super-journal file for reading.
5441154412
*/
@@ -54426,15 +54427,17 @@
5442654427
** files extracted from regular rollback-journals.
5442754428
*/
5442854429
rc = sqlite3OsFileSize(pSuper, &nSuperJournal);
5442954430
if( rc!=SQLITE_OK ) goto delsuper_out;
5443054431
nSuperPtr = pVfs->mxPathname+1;
54431
- zSuperJournal = sqlite3Malloc(nSuperJournal + nSuperPtr + 2);
54432
- if( !zSuperJournal ){
54432
+ zFree = sqlite3Malloc(4 + nSuperJournal + nSuperPtr + 2);
54433
+ if( !zFree ){
5443354434
rc = SQLITE_NOMEM_BKPT;
5443454435
goto delsuper_out;
5443554436
}
54437
+ zFree[0] = zFree[1] = zFree[2] = zFree[3] = 0;
54438
+ zSuperJournal = &zFree[4];
5443654439
zSuperPtr = &zSuperJournal[nSuperJournal+2];
5443754440
rc = sqlite3OsRead(pSuper, zSuperJournal, (int)nSuperJournal, 0);
5443854441
if( rc!=SQLITE_OK ) goto delsuper_out;
5443954442
zSuperJournal[nSuperJournal] = 0;
5444054443
zSuperJournal[nSuperJournal+1] = 0;
@@ -54478,11 +54481,11 @@
5447854481
5447954482
sqlite3OsClose(pSuper);
5448054483
rc = sqlite3OsDelete(pVfs, zSuper, 0);
5448154484
5448254485
delsuper_out:
54483
- sqlite3_free(zSuperJournal);
54486
+ sqlite3_free(zFree);
5448454487
if( pSuper ){
5448554488
sqlite3OsClose(pSuper);
5448654489
assert( !isOpen(pJournal) );
5448754490
sqlite3_free(pSuper);
5448854491
}
@@ -54816,11 +54819,15 @@
5481654819
** in case this has happened, clear the changeCountDone flag now.
5481754820
*/
5481854821
pPager->changeCountDone = pPager->tempFile;
5481954822
5482054823
if( rc==SQLITE_OK ){
54821
- zSuper = pPager->pTmpSpace;
54824
+ /* Leave 4 bytes of space before the super-journal filename in memory.
54825
+ ** This is because it may end up being passed to sqlite3OsOpen(), in
54826
+ ** which case it requires 4 0x00 bytes in memory immediately before
54827
+ ** the filename. */
54828
+ zSuper = &pPager->pTmpSpace[4];
5482254829
rc = readSuperJournal(pPager->jfd, zSuper, pPager->pVfs->mxPathname+1);
5482354830
testcase( rc!=SQLITE_OK );
5482454831
}
5482554832
if( rc==SQLITE_OK
5482654833
&& (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
@@ -54833,10 +54840,12 @@
5483354840
}
5483454841
if( rc==SQLITE_OK && zSuper[0] && res ){
5483554842
/* If there was a super-journal and this routine will return success,
5483654843
** see if it is possible to delete the super-journal.
5483754844
*/
54845
+ assert( zSuper==&pPager->pTmpSpace[4] );
54846
+ memset(&zSuper[-4], 0, 4);
5483854847
rc = pager_delsuper(pPager, zSuper);
5483954848
testcase( rc!=SQLITE_OK );
5484054849
}
5484154850
if( isHot && nPlayback ){
5484254851
sqlite3_log(SQLITE_NOTICE_RECOVER_ROLLBACK, "recovered %d pages from %s",
@@ -64822,11 +64831,11 @@
6482264831
#define hasReadConflicts(a, b) 0
6482364832
#endif
6482464833
6482564834
#ifdef SQLITE_DEBUG
6482664835
/*
64827
-** Return an reset the seek counter for a Btree object.
64836
+** Return and reset the seek counter for a Btree object.
6482864837
*/
6482964838
SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree *pBt){
6483064839
u64 n = pBt->nSeek;
6483164840
pBt->nSeek = 0;
6483264841
return n;
@@ -124412,10 +124421,12 @@
124412124421
/* Version 3.32.0 and later */
124413124422
char *(*create_filename)(const char*,const char*,const char*,
124414124423
int,const char**);
124415124424
void (*free_filename)(char*);
124416124425
sqlite3_file *(*database_file_object)(const char*);
124426
+ /* Version 3.34.0 and later */
124427
+ int (*txn_state)(sqlite3*,const char*);
124417124428
};
124418124429
124419124430
/*
124420124431
** This is the function signature used for all extension entry points. It
124421124432
** is also defined in the file "loadext.c".
@@ -124716,10 +124727,12 @@
124716124727
#define sqlite3_filename_wal sqlite3_api->filename_wal
124717124728
/* Version 3.32.0 and later */
124718124729
#define sqlite3_create_filename sqlite3_api->create_filename
124719124730
#define sqlite3_free_filename sqlite3_api->free_filename
124720124731
#define sqlite3_database_file_object sqlite3_api->database_file_object
124732
+/* Version 3.34.0 and later */
124733
+#define sqlite3_txn_state sqlite3_api->txn_state
124721124734
#endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
124722124735
124723124736
#if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
124724124737
/* This case when the file really is being compiled as a loadable
124725124738
** extension */
@@ -125198,10 +125211,12 @@
125198125211
sqlite3_filename_wal,
125199125212
/* Version 3.32.0 and later */
125200125213
sqlite3_create_filename,
125201125214
sqlite3_free_filename,
125202125215
sqlite3_database_file_object,
125216
+ /* Version 3.34.0 and later */
125217
+ sqlite3_txn_state,
125203125218
};
125204125219
125205125220
/* True if x is the directory separator character
125206125221
*/
125207125222
#if SQLITE_OS_WIN
@@ -194344,11 +194359,11 @@
194344194359
p->aSegment = (GeoSegment*)&p->aEvent[nVertex*2];
194345194360
p->nEvent = p->nSegment = 0;
194346194361
geopolyAddSegments(p, p1, 1);
194347194362
geopolyAddSegments(p, p2, 2);
194348194363
pThisEvent = geopolySortEventsByX(p->aEvent, p->nEvent);
194349
- rX = pThisEvent->x==0.0 ? -1.0 : 0.0;
194364
+ rX = pThisEvent && pThisEvent->x==0.0 ? -1.0 : 0.0;
194350194365
memset(aOverlap, 0, sizeof(aOverlap));
194351194366
while( pThisEvent ){
194352194367
if( pThisEvent->x!=rX ){
194353194368
GeoSegment *pPrev = 0;
194354194369
int iMask = 0;
@@ -212253,11 +212268,11 @@
212253212268
Fts5Bm25Data **ppData /* OUT: bm25-data object for this query */
212254212269
){
212255212270
int rc = SQLITE_OK; /* Return code */
212256212271
Fts5Bm25Data *p; /* Object to return */
212257212272
212258
- p = pApi->xGetAuxdata(pFts, 0);
212273
+ p = (Fts5Bm25Data*)pApi->xGetAuxdata(pFts, 0);
212259212274
if( p==0 ){
212260212275
int nPhrase; /* Number of phrases in query */
212261212276
sqlite3_int64 nRow = 0; /* Number of rows in table */
212262212277
sqlite3_int64 nToken = 0; /* Number of tokens in table */
212263212278
sqlite3_int64 nByte; /* Bytes of space to allocate */
@@ -212327,11 +212342,11 @@
212327212342
int nVal, /* Number of values in apVal[] array */
212328212343
sqlite3_value **apVal /* Array of trailing arguments */
212329212344
){
212330212345
const double k1 = 1.2; /* Constant "k1" from BM25 formula */
212331212346
const double b = 0.75; /* Constant "b" from BM25 formula */
212332
- int rc = SQLITE_OK; /* Error code */
212347
+ int rc; /* Error code */
212333212348
double score = 0.0; /* SQL function return value */
212334212349
Fts5Bm25Data *pData; /* Values allocated/calculated once only */
212335212350
int i; /* Iterator variable */
212336212351
int nInst = 0; /* Value returned by xInstCount() */
212337212352
double D = 0.0; /* Total number of tokens in row */
@@ -212359,21 +212374,19 @@
212359212374
int nTok;
212360212375
rc = pApi->xColumnSize(pFts, -1, &nTok);
212361212376
D = (double)nTok;
212362212377
}
212363212378
212364
- /* Determine the BM25 score for the current row. */
212365
- for(i=0; rc==SQLITE_OK && i<pData->nPhrase; i++){
212366
- score += pData->aIDF[i] * (
212367
- ( aFreq[i] * (k1 + 1.0) ) /
212368
- ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
212369
- );
212370
- }
212371
-
212372
- /* If no error has occurred, return the calculated score. Otherwise,
212373
- ** throw an SQL exception. */
212379
+ /* Determine and return the BM25 score for the current row. Or, if an
212380
+ ** error has occurred, throw an exception. */
212374212381
if( rc==SQLITE_OK ){
212382
+ for(i=0; i<pData->nPhrase; i++){
212383
+ score += pData->aIDF[i] * (
212384
+ ( aFreq[i] * (k1 + 1.0) ) /
212385
+ ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
212386
+ );
212387
+ }
212375212388
sqlite3_result_double(pCtx, -1.0 * score);
212376212389
}else{
212377212390
sqlite3_result_error_code(pCtx, rc);
212378212391
}
212379212392
}
@@ -223508,10 +223521,11 @@
223508223521
cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, 0, 0, -1, z, n);
223509223522
}
223510223523
}else{
223511223524
poslist.n = 0;
223512223525
fts5SegiterPoslist(p, &pIter->aSeg[pIter->aFirst[1].iFirst], 0, &poslist);
223526
+ fts5BufferAppendBlob(&p->rc, &poslist, 4, (const u8*)"\0\0\0\0");
223513223527
while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){
223514223528
int iCol = FTS5_POS2COLUMN(iPos);
223515223529
int iTokOff = FTS5_POS2OFFSET(iPos);
223516223530
cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, iCol, iTokOff, -1, z, n);
223517223531
}
@@ -226803,11 +226817,11 @@
226803226817
int nArg, /* Number of args */
226804226818
sqlite3_value **apUnused /* Function arguments */
226805226819
){
226806226820
assert( nArg==0 );
226807226821
UNUSED_PARAM2(nArg, apUnused);
226808
- sqlite3_result_text(pCtx, "fts5: 2020-11-19 21:12:08 c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde", -1, SQLITE_TRANSIENT);
226822
+ sqlite3_result_text(pCtx, "fts5: 2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b", -1, SQLITE_TRANSIENT);
226809226823
}
226810226824
226811226825
/*
226812226826
** Return true if zName is the extension on one of the shadow tables used
226813226827
** by this module.
@@ -229376,17 +229390,18 @@
229376229390
229377229391
/*
229378229392
** Allocate a trigram tokenizer.
229379229393
*/
229380229394
static int fts5TriCreate(
229381
- void *pCtx,
229395
+ void *pUnused,
229382229396
const char **azArg,
229383229397
int nArg,
229384229398
Fts5Tokenizer **ppOut
229385229399
){
229386229400
int rc = SQLITE_OK;
229387229401
TrigramTokenizer *pNew = (TrigramTokenizer*)sqlite3_malloc(sizeof(*pNew));
229402
+ UNUSED_PARAM(pUnused);
229388229403
if( pNew==0 ){
229389229404
rc = SQLITE_NOMEM;
229390229405
}else{
229391229406
int i;
229392229407
pNew->bFold = 1;
@@ -229415,11 +229430,11 @@
229415229430
** Trigram tokenizer tokenize routine.
229416229431
*/
229417229432
static int fts5TriTokenize(
229418229433
Fts5Tokenizer *pTok,
229419229434
void *pCtx,
229420
- int flags,
229435
+ int unusedFlags,
229421229436
const char *pText, int nText,
229422229437
int (*xToken)(void*, int, const char*, int, int, int)
229423229438
){
229424229439
TrigramTokenizer *p = (TrigramTokenizer*)pTok;
229425229440
int rc = SQLITE_OK;
@@ -229426,10 +229441,11 @@
229426229441
char aBuf[32];
229427229442
const unsigned char *zIn = (const unsigned char*)pText;
229428229443
const unsigned char *zEof = &zIn[nText];
229429229444
u32 iCode;
229430229445
229446
+ UNUSED_PARAM(unusedFlags);
229431229447
while( 1 ){
229432229448
char *zOut = aBuf;
229433229449
int iStart = zIn - (const unsigned char*)pText;
229434229450
const unsigned char *zNext;
229435229451
@@ -230288,10 +230304,11 @@
230288230304
}
230289230305
iTbl++;
230290230306
}
230291230307
aAscii[0] = 0; /* 0x00 is never a token character */
230292230308
}
230309
+
230293230310
230294230311
/*
230295230312
** 2015 May 30
230296230313
**
230297230314
** The author disclaims copyright to this source code. In place of
@@ -231726,12 +231743,12 @@
231726231743
}
231727231744
#endif /* SQLITE_CORE */
231728231745
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231729231746
231730231747
/************** End of stmt.c ************************************************/
231731
-#if __LINE__!=231731
231748
+#if __LINE__!=231748
231732231749
#undef SQLITE_SOURCE_ID
231733
-#define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0alt2"
231750
+#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089falt2"
231734231751
#endif
231735231752
/* Return the source-id for this library */
231736231753
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231737231754
/************************** End of sqlite3.c ******************************/
231738231755
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.34.0"
1175 #define SQLITE_VERSION_NUMBER 3034000
1176 #define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -7239,11 +7239,11 @@
7239 ** CAPI3REF: Determine the transaction state of a database
7240 ** METHOD: sqlite3
7241 **
7242 ** ^The sqlite3_txn_state(D,S) interface returns the current
7243 ** [transaction state] of schema S in database connection D. ^If S is NULL,
7244 ** then the highest transaction state of any schema on databse connection D
7245 ** is returned. Transaction states are (in order of lowest to highest):
7246 ** <ol>
7247 ** <li value="0"> SQLITE_TXN_NONE
7248 ** <li value="1"> SQLITE_TXN_READ
7249 ** <li value="2"> SQLITE_TXN_WRITE
@@ -8786,11 +8786,10 @@
8786 */
8787 #define SQLITE_TESTCTRL_FIRST 5
8788 #define SQLITE_TESTCTRL_PRNG_SAVE 5
8789 #define SQLITE_TESTCTRL_PRNG_RESTORE 6
8790 #define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
8791 #define SQLITE_TESTCTRL_SEEK_COUNT 7
8792 #define SQLITE_TESTCTRL_BITVEC_TEST 8
8793 #define SQLITE_TESTCTRL_FAULT_INSTALL 9
8794 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
8795 #define SQLITE_TESTCTRL_PENDING_BYTE 11
8796 #define SQLITE_TESTCTRL_ASSERT 12
@@ -8811,11 +8810,12 @@
8811 #define SQLITE_TESTCTRL_IMPOSTER 25
8812 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
8813 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
8814 #define SQLITE_TESTCTRL_PRNG_SEED 28
8815 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
8816 #define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
 
8817
8818 /*
8819 ** CAPI3REF: SQL Keyword Checking
8820 **
8821 ** These routines provide access to the set of SQL language keywords
@@ -54402,10 +54402,11 @@
54402 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
54403 char *zSuperJournal = 0; /* Contents of super-journal file */
54404 i64 nSuperJournal; /* Size of super-journal file */
54405 char *zJournal; /* Pointer to one journal within MJ file */
54406 char *zSuperPtr; /* Space to hold super-journal filename */
 
54407 int nSuperPtr; /* Amount of space allocated to zSuperPtr[] */
54408
54409 /* Allocate space for both the pJournal and pSuper file descriptors.
54410 ** If successful, open the super-journal file for reading.
54411 */
@@ -54426,15 +54427,17 @@
54426 ** files extracted from regular rollback-journals.
54427 */
54428 rc = sqlite3OsFileSize(pSuper, &nSuperJournal);
54429 if( rc!=SQLITE_OK ) goto delsuper_out;
54430 nSuperPtr = pVfs->mxPathname+1;
54431 zSuperJournal = sqlite3Malloc(nSuperJournal + nSuperPtr + 2);
54432 if( !zSuperJournal ){
54433 rc = SQLITE_NOMEM_BKPT;
54434 goto delsuper_out;
54435 }
 
 
54436 zSuperPtr = &zSuperJournal[nSuperJournal+2];
54437 rc = sqlite3OsRead(pSuper, zSuperJournal, (int)nSuperJournal, 0);
54438 if( rc!=SQLITE_OK ) goto delsuper_out;
54439 zSuperJournal[nSuperJournal] = 0;
54440 zSuperJournal[nSuperJournal+1] = 0;
@@ -54478,11 +54481,11 @@
54478
54479 sqlite3OsClose(pSuper);
54480 rc = sqlite3OsDelete(pVfs, zSuper, 0);
54481
54482 delsuper_out:
54483 sqlite3_free(zSuperJournal);
54484 if( pSuper ){
54485 sqlite3OsClose(pSuper);
54486 assert( !isOpen(pJournal) );
54487 sqlite3_free(pSuper);
54488 }
@@ -54816,11 +54819,15 @@
54816 ** in case this has happened, clear the changeCountDone flag now.
54817 */
54818 pPager->changeCountDone = pPager->tempFile;
54819
54820 if( rc==SQLITE_OK ){
54821 zSuper = pPager->pTmpSpace;
 
 
 
 
54822 rc = readSuperJournal(pPager->jfd, zSuper, pPager->pVfs->mxPathname+1);
54823 testcase( rc!=SQLITE_OK );
54824 }
54825 if( rc==SQLITE_OK
54826 && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
@@ -54833,10 +54840,12 @@
54833 }
54834 if( rc==SQLITE_OK && zSuper[0] && res ){
54835 /* If there was a super-journal and this routine will return success,
54836 ** see if it is possible to delete the super-journal.
54837 */
 
 
54838 rc = pager_delsuper(pPager, zSuper);
54839 testcase( rc!=SQLITE_OK );
54840 }
54841 if( isHot && nPlayback ){
54842 sqlite3_log(SQLITE_NOTICE_RECOVER_ROLLBACK, "recovered %d pages from %s",
@@ -64822,11 +64831,11 @@
64822 #define hasReadConflicts(a, b) 0
64823 #endif
64824
64825 #ifdef SQLITE_DEBUG
64826 /*
64827 ** Return an reset the seek counter for a Btree object.
64828 */
64829 SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree *pBt){
64830 u64 n = pBt->nSeek;
64831 pBt->nSeek = 0;
64832 return n;
@@ -124412,10 +124421,12 @@
124412 /* Version 3.32.0 and later */
124413 char *(*create_filename)(const char*,const char*,const char*,
124414 int,const char**);
124415 void (*free_filename)(char*);
124416 sqlite3_file *(*database_file_object)(const char*);
 
 
124417 };
124418
124419 /*
124420 ** This is the function signature used for all extension entry points. It
124421 ** is also defined in the file "loadext.c".
@@ -124716,10 +124727,12 @@
124716 #define sqlite3_filename_wal sqlite3_api->filename_wal
124717 /* Version 3.32.0 and later */
124718 #define sqlite3_create_filename sqlite3_api->create_filename
124719 #define sqlite3_free_filename sqlite3_api->free_filename
124720 #define sqlite3_database_file_object sqlite3_api->database_file_object
 
 
124721 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
124722
124723 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
124724 /* This case when the file really is being compiled as a loadable
124725 ** extension */
@@ -125198,10 +125211,12 @@
125198 sqlite3_filename_wal,
125199 /* Version 3.32.0 and later */
125200 sqlite3_create_filename,
125201 sqlite3_free_filename,
125202 sqlite3_database_file_object,
 
 
125203 };
125204
125205 /* True if x is the directory separator character
125206 */
125207 #if SQLITE_OS_WIN
@@ -194344,11 +194359,11 @@
194344 p->aSegment = (GeoSegment*)&p->aEvent[nVertex*2];
194345 p->nEvent = p->nSegment = 0;
194346 geopolyAddSegments(p, p1, 1);
194347 geopolyAddSegments(p, p2, 2);
194348 pThisEvent = geopolySortEventsByX(p->aEvent, p->nEvent);
194349 rX = pThisEvent->x==0.0 ? -1.0 : 0.0;
194350 memset(aOverlap, 0, sizeof(aOverlap));
194351 while( pThisEvent ){
194352 if( pThisEvent->x!=rX ){
194353 GeoSegment *pPrev = 0;
194354 int iMask = 0;
@@ -212253,11 +212268,11 @@
212253 Fts5Bm25Data **ppData /* OUT: bm25-data object for this query */
212254 ){
212255 int rc = SQLITE_OK; /* Return code */
212256 Fts5Bm25Data *p; /* Object to return */
212257
212258 p = pApi->xGetAuxdata(pFts, 0);
212259 if( p==0 ){
212260 int nPhrase; /* Number of phrases in query */
212261 sqlite3_int64 nRow = 0; /* Number of rows in table */
212262 sqlite3_int64 nToken = 0; /* Number of tokens in table */
212263 sqlite3_int64 nByte; /* Bytes of space to allocate */
@@ -212327,11 +212342,11 @@
212327 int nVal, /* Number of values in apVal[] array */
212328 sqlite3_value **apVal /* Array of trailing arguments */
212329 ){
212330 const double k1 = 1.2; /* Constant "k1" from BM25 formula */
212331 const double b = 0.75; /* Constant "b" from BM25 formula */
212332 int rc = SQLITE_OK; /* Error code */
212333 double score = 0.0; /* SQL function return value */
212334 Fts5Bm25Data *pData; /* Values allocated/calculated once only */
212335 int i; /* Iterator variable */
212336 int nInst = 0; /* Value returned by xInstCount() */
212337 double D = 0.0; /* Total number of tokens in row */
@@ -212359,21 +212374,19 @@
212359 int nTok;
212360 rc = pApi->xColumnSize(pFts, -1, &nTok);
212361 D = (double)nTok;
212362 }
212363
212364 /* Determine the BM25 score for the current row. */
212365 for(i=0; rc==SQLITE_OK && i<pData->nPhrase; i++){
212366 score += pData->aIDF[i] * (
212367 ( aFreq[i] * (k1 + 1.0) ) /
212368 ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
212369 );
212370 }
212371
212372 /* If no error has occurred, return the calculated score. Otherwise,
212373 ** throw an SQL exception. */
212374 if( rc==SQLITE_OK ){
 
 
 
 
 
 
212375 sqlite3_result_double(pCtx, -1.0 * score);
212376 }else{
212377 sqlite3_result_error_code(pCtx, rc);
212378 }
212379 }
@@ -223508,10 +223521,11 @@
223508 cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, 0, 0, -1, z, n);
223509 }
223510 }else{
223511 poslist.n = 0;
223512 fts5SegiterPoslist(p, &pIter->aSeg[pIter->aFirst[1].iFirst], 0, &poslist);
 
223513 while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){
223514 int iCol = FTS5_POS2COLUMN(iPos);
223515 int iTokOff = FTS5_POS2OFFSET(iPos);
223516 cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, iCol, iTokOff, -1, z, n);
223517 }
@@ -226803,11 +226817,11 @@
226803 int nArg, /* Number of args */
226804 sqlite3_value **apUnused /* Function arguments */
226805 ){
226806 assert( nArg==0 );
226807 UNUSED_PARAM2(nArg, apUnused);
226808 sqlite3_result_text(pCtx, "fts5: 2020-11-19 21:12:08 c38dec6f52c01614c1bee8356daf0fcd9f708d029116e9bff51e06719a730dde", -1, SQLITE_TRANSIENT);
226809 }
226810
226811 /*
226812 ** Return true if zName is the extension on one of the shadow tables used
226813 ** by this module.
@@ -229376,17 +229390,18 @@
229376
229377 /*
229378 ** Allocate a trigram tokenizer.
229379 */
229380 static int fts5TriCreate(
229381 void *pCtx,
229382 const char **azArg,
229383 int nArg,
229384 Fts5Tokenizer **ppOut
229385 ){
229386 int rc = SQLITE_OK;
229387 TrigramTokenizer *pNew = (TrigramTokenizer*)sqlite3_malloc(sizeof(*pNew));
 
229388 if( pNew==0 ){
229389 rc = SQLITE_NOMEM;
229390 }else{
229391 int i;
229392 pNew->bFold = 1;
@@ -229415,11 +229430,11 @@
229415 ** Trigram tokenizer tokenize routine.
229416 */
229417 static int fts5TriTokenize(
229418 Fts5Tokenizer *pTok,
229419 void *pCtx,
229420 int flags,
229421 const char *pText, int nText,
229422 int (*xToken)(void*, int, const char*, int, int, int)
229423 ){
229424 TrigramTokenizer *p = (TrigramTokenizer*)pTok;
229425 int rc = SQLITE_OK;
@@ -229426,10 +229441,11 @@
229426 char aBuf[32];
229427 const unsigned char *zIn = (const unsigned char*)pText;
229428 const unsigned char *zEof = &zIn[nText];
229429 u32 iCode;
229430
 
229431 while( 1 ){
229432 char *zOut = aBuf;
229433 int iStart = zIn - (const unsigned char*)pText;
229434 const unsigned char *zNext;
229435
@@ -230288,10 +230304,11 @@
230288 }
230289 iTbl++;
230290 }
230291 aAscii[0] = 0; /* 0x00 is never a token character */
230292 }
 
230293
230294 /*
230295 ** 2015 May 30
230296 **
230297 ** The author disclaims copyright to this source code. In place of
@@ -231726,12 +231743,12 @@
231726 }
231727 #endif /* SQLITE_CORE */
231728 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231729
231730 /************** End of stmt.c ************************************************/
231731 #if __LINE__!=231731
231732 #undef SQLITE_SOURCE_ID
231733 #define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0alt2"
231734 #endif
231735 /* Return the source-id for this library */
231736 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231737 /************************** End of sqlite3.c ******************************/
231738
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -1171,11 +1171,11 @@
1171 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
1172 ** [sqlite_version()] and [sqlite_source_id()].
1173 */
1174 #define SQLITE_VERSION "3.34.0"
1175 #define SQLITE_VERSION_NUMBER 3034000
1176 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
1177
1178 /*
1179 ** CAPI3REF: Run-Time Library Version Numbers
1180 ** KEYWORDS: sqlite3_version sqlite3_sourceid
1181 **
@@ -7239,11 +7239,11 @@
7239 ** CAPI3REF: Determine the transaction state of a database
7240 ** METHOD: sqlite3
7241 **
7242 ** ^The sqlite3_txn_state(D,S) interface returns the current
7243 ** [transaction state] of schema S in database connection D. ^If S is NULL,
7244 ** then the highest transaction state of any schema on database connection D
7245 ** is returned. Transaction states are (in order of lowest to highest):
7246 ** <ol>
7247 ** <li value="0"> SQLITE_TXN_NONE
7248 ** <li value="1"> SQLITE_TXN_READ
7249 ** <li value="2"> SQLITE_TXN_WRITE
@@ -8786,11 +8786,10 @@
8786 */
8787 #define SQLITE_TESTCTRL_FIRST 5
8788 #define SQLITE_TESTCTRL_PRNG_SAVE 5
8789 #define SQLITE_TESTCTRL_PRNG_RESTORE 6
8790 #define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
 
8791 #define SQLITE_TESTCTRL_BITVEC_TEST 8
8792 #define SQLITE_TESTCTRL_FAULT_INSTALL 9
8793 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
8794 #define SQLITE_TESTCTRL_PENDING_BYTE 11
8795 #define SQLITE_TESTCTRL_ASSERT 12
@@ -8811,11 +8810,12 @@
8810 #define SQLITE_TESTCTRL_IMPOSTER 25
8811 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
8812 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
8813 #define SQLITE_TESTCTRL_PRNG_SEED 28
8814 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
8815 #define SQLITE_TESTCTRL_SEEK_COUNT 30
8816 #define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
8817
8818 /*
8819 ** CAPI3REF: SQL Keyword Checking
8820 **
8821 ** These routines provide access to the set of SQL language keywords
@@ -54402,10 +54402,11 @@
54402 sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */
54403 char *zSuperJournal = 0; /* Contents of super-journal file */
54404 i64 nSuperJournal; /* Size of super-journal file */
54405 char *zJournal; /* Pointer to one journal within MJ file */
54406 char *zSuperPtr; /* Space to hold super-journal filename */
54407 char *zFree = 0; /* Free this buffer */
54408 int nSuperPtr; /* Amount of space allocated to zSuperPtr[] */
54409
54410 /* Allocate space for both the pJournal and pSuper file descriptors.
54411 ** If successful, open the super-journal file for reading.
54412 */
@@ -54426,15 +54427,17 @@
54427 ** files extracted from regular rollback-journals.
54428 */
54429 rc = sqlite3OsFileSize(pSuper, &nSuperJournal);
54430 if( rc!=SQLITE_OK ) goto delsuper_out;
54431 nSuperPtr = pVfs->mxPathname+1;
54432 zFree = sqlite3Malloc(4 + nSuperJournal + nSuperPtr + 2);
54433 if( !zFree ){
54434 rc = SQLITE_NOMEM_BKPT;
54435 goto delsuper_out;
54436 }
54437 zFree[0] = zFree[1] = zFree[2] = zFree[3] = 0;
54438 zSuperJournal = &zFree[4];
54439 zSuperPtr = &zSuperJournal[nSuperJournal+2];
54440 rc = sqlite3OsRead(pSuper, zSuperJournal, (int)nSuperJournal, 0);
54441 if( rc!=SQLITE_OK ) goto delsuper_out;
54442 zSuperJournal[nSuperJournal] = 0;
54443 zSuperJournal[nSuperJournal+1] = 0;
@@ -54478,11 +54481,11 @@
54481
54482 sqlite3OsClose(pSuper);
54483 rc = sqlite3OsDelete(pVfs, zSuper, 0);
54484
54485 delsuper_out:
54486 sqlite3_free(zFree);
54487 if( pSuper ){
54488 sqlite3OsClose(pSuper);
54489 assert( !isOpen(pJournal) );
54490 sqlite3_free(pSuper);
54491 }
@@ -54816,11 +54819,15 @@
54819 ** in case this has happened, clear the changeCountDone flag now.
54820 */
54821 pPager->changeCountDone = pPager->tempFile;
54822
54823 if( rc==SQLITE_OK ){
54824 /* Leave 4 bytes of space before the super-journal filename in memory.
54825 ** This is because it may end up being passed to sqlite3OsOpen(), in
54826 ** which case it requires 4 0x00 bytes in memory immediately before
54827 ** the filename. */
54828 zSuper = &pPager->pTmpSpace[4];
54829 rc = readSuperJournal(pPager->jfd, zSuper, pPager->pVfs->mxPathname+1);
54830 testcase( rc!=SQLITE_OK );
54831 }
54832 if( rc==SQLITE_OK
54833 && (pPager->eState>=PAGER_WRITER_DBMOD || pPager->eState==PAGER_OPEN)
@@ -54833,10 +54840,12 @@
54840 }
54841 if( rc==SQLITE_OK && zSuper[0] && res ){
54842 /* If there was a super-journal and this routine will return success,
54843 ** see if it is possible to delete the super-journal.
54844 */
54845 assert( zSuper==&pPager->pTmpSpace[4] );
54846 memset(&zSuper[-4], 0, 4);
54847 rc = pager_delsuper(pPager, zSuper);
54848 testcase( rc!=SQLITE_OK );
54849 }
54850 if( isHot && nPlayback ){
54851 sqlite3_log(SQLITE_NOTICE_RECOVER_ROLLBACK, "recovered %d pages from %s",
@@ -64822,11 +64831,11 @@
64831 #define hasReadConflicts(a, b) 0
64832 #endif
64833
64834 #ifdef SQLITE_DEBUG
64835 /*
64836 ** Return and reset the seek counter for a Btree object.
64837 */
64838 SQLITE_PRIVATE sqlite3_uint64 sqlite3BtreeSeekCount(Btree *pBt){
64839 u64 n = pBt->nSeek;
64840 pBt->nSeek = 0;
64841 return n;
@@ -124412,10 +124421,12 @@
124421 /* Version 3.32.0 and later */
124422 char *(*create_filename)(const char*,const char*,const char*,
124423 int,const char**);
124424 void (*free_filename)(char*);
124425 sqlite3_file *(*database_file_object)(const char*);
124426 /* Version 3.34.0 and later */
124427 int (*txn_state)(sqlite3*,const char*);
124428 };
124429
124430 /*
124431 ** This is the function signature used for all extension entry points. It
124432 ** is also defined in the file "loadext.c".
@@ -124716,10 +124727,12 @@
124727 #define sqlite3_filename_wal sqlite3_api->filename_wal
124728 /* Version 3.32.0 and later */
124729 #define sqlite3_create_filename sqlite3_api->create_filename
124730 #define sqlite3_free_filename sqlite3_api->free_filename
124731 #define sqlite3_database_file_object sqlite3_api->database_file_object
124732 /* Version 3.34.0 and later */
124733 #define sqlite3_txn_state sqlite3_api->txn_state
124734 #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */
124735
124736 #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION)
124737 /* This case when the file really is being compiled as a loadable
124738 ** extension */
@@ -125198,10 +125211,12 @@
125211 sqlite3_filename_wal,
125212 /* Version 3.32.0 and later */
125213 sqlite3_create_filename,
125214 sqlite3_free_filename,
125215 sqlite3_database_file_object,
125216 /* Version 3.34.0 and later */
125217 sqlite3_txn_state,
125218 };
125219
125220 /* True if x is the directory separator character
125221 */
125222 #if SQLITE_OS_WIN
@@ -194344,11 +194359,11 @@
194359 p->aSegment = (GeoSegment*)&p->aEvent[nVertex*2];
194360 p->nEvent = p->nSegment = 0;
194361 geopolyAddSegments(p, p1, 1);
194362 geopolyAddSegments(p, p2, 2);
194363 pThisEvent = geopolySortEventsByX(p->aEvent, p->nEvent);
194364 rX = pThisEvent && pThisEvent->x==0.0 ? -1.0 : 0.0;
194365 memset(aOverlap, 0, sizeof(aOverlap));
194366 while( pThisEvent ){
194367 if( pThisEvent->x!=rX ){
194368 GeoSegment *pPrev = 0;
194369 int iMask = 0;
@@ -212253,11 +212268,11 @@
212268 Fts5Bm25Data **ppData /* OUT: bm25-data object for this query */
212269 ){
212270 int rc = SQLITE_OK; /* Return code */
212271 Fts5Bm25Data *p; /* Object to return */
212272
212273 p = (Fts5Bm25Data*)pApi->xGetAuxdata(pFts, 0);
212274 if( p==0 ){
212275 int nPhrase; /* Number of phrases in query */
212276 sqlite3_int64 nRow = 0; /* Number of rows in table */
212277 sqlite3_int64 nToken = 0; /* Number of tokens in table */
212278 sqlite3_int64 nByte; /* Bytes of space to allocate */
@@ -212327,11 +212342,11 @@
212342 int nVal, /* Number of values in apVal[] array */
212343 sqlite3_value **apVal /* Array of trailing arguments */
212344 ){
212345 const double k1 = 1.2; /* Constant "k1" from BM25 formula */
212346 const double b = 0.75; /* Constant "b" from BM25 formula */
212347 int rc; /* Error code */
212348 double score = 0.0; /* SQL function return value */
212349 Fts5Bm25Data *pData; /* Values allocated/calculated once only */
212350 int i; /* Iterator variable */
212351 int nInst = 0; /* Value returned by xInstCount() */
212352 double D = 0.0; /* Total number of tokens in row */
@@ -212359,21 +212374,19 @@
212374 int nTok;
212375 rc = pApi->xColumnSize(pFts, -1, &nTok);
212376 D = (double)nTok;
212377 }
212378
212379 /* Determine and return the BM25 score for the current row. Or, if an
212380 ** error has occurred, throw an exception. */
 
 
 
 
 
 
 
 
212381 if( rc==SQLITE_OK ){
212382 for(i=0; i<pData->nPhrase; i++){
212383 score += pData->aIDF[i] * (
212384 ( aFreq[i] * (k1 + 1.0) ) /
212385 ( aFreq[i] + k1 * (1 - b + b * D / pData->avgdl) )
212386 );
212387 }
212388 sqlite3_result_double(pCtx, -1.0 * score);
212389 }else{
212390 sqlite3_result_error_code(pCtx, rc);
212391 }
212392 }
@@ -223508,10 +223521,11 @@
223521 cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, 0, 0, -1, z, n);
223522 }
223523 }else{
223524 poslist.n = 0;
223525 fts5SegiterPoslist(p, &pIter->aSeg[pIter->aFirst[1].iFirst], 0, &poslist);
223526 fts5BufferAppendBlob(&p->rc, &poslist, 4, (const u8*)"\0\0\0\0");
223527 while( 0==sqlite3Fts5PoslistNext64(poslist.p, poslist.n, &iOff, &iPos) ){
223528 int iCol = FTS5_POS2COLUMN(iPos);
223529 int iTokOff = FTS5_POS2OFFSET(iPos);
223530 cksum2 ^= sqlite3Fts5IndexEntryCksum(iRowid, iCol, iTokOff, -1, z, n);
223531 }
@@ -226803,11 +226817,11 @@
226817 int nArg, /* Number of args */
226818 sqlite3_value **apUnused /* Function arguments */
226819 ){
226820 assert( nArg==0 );
226821 UNUSED_PARAM2(nArg, apUnused);
226822 sqlite3_result_text(pCtx, "fts5: 2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b", -1, SQLITE_TRANSIENT);
226823 }
226824
226825 /*
226826 ** Return true if zName is the extension on one of the shadow tables used
226827 ** by this module.
@@ -229376,17 +229390,18 @@
229390
229391 /*
229392 ** Allocate a trigram tokenizer.
229393 */
229394 static int fts5TriCreate(
229395 void *pUnused,
229396 const char **azArg,
229397 int nArg,
229398 Fts5Tokenizer **ppOut
229399 ){
229400 int rc = SQLITE_OK;
229401 TrigramTokenizer *pNew = (TrigramTokenizer*)sqlite3_malloc(sizeof(*pNew));
229402 UNUSED_PARAM(pUnused);
229403 if( pNew==0 ){
229404 rc = SQLITE_NOMEM;
229405 }else{
229406 int i;
229407 pNew->bFold = 1;
@@ -229415,11 +229430,11 @@
229430 ** Trigram tokenizer tokenize routine.
229431 */
229432 static int fts5TriTokenize(
229433 Fts5Tokenizer *pTok,
229434 void *pCtx,
229435 int unusedFlags,
229436 const char *pText, int nText,
229437 int (*xToken)(void*, int, const char*, int, int, int)
229438 ){
229439 TrigramTokenizer *p = (TrigramTokenizer*)pTok;
229440 int rc = SQLITE_OK;
@@ -229426,10 +229441,11 @@
229441 char aBuf[32];
229442 const unsigned char *zIn = (const unsigned char*)pText;
229443 const unsigned char *zEof = &zIn[nText];
229444 u32 iCode;
229445
229446 UNUSED_PARAM(unusedFlags);
229447 while( 1 ){
229448 char *zOut = aBuf;
229449 int iStart = zIn - (const unsigned char*)pText;
229450 const unsigned char *zNext;
229451
@@ -230288,10 +230304,11 @@
230304 }
230305 iTbl++;
230306 }
230307 aAscii[0] = 0; /* 0x00 is never a token character */
230308 }
230309
230310
230311 /*
230312 ** 2015 May 30
230313 **
230314 ** The author disclaims copyright to this source code. In place of
@@ -231726,12 +231743,12 @@
231743 }
231744 #endif /* SQLITE_CORE */
231745 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
231746
231747 /************** End of stmt.c ************************************************/
231748 #if __LINE__!=231748
231749 #undef SQLITE_SOURCE_ID
231750 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089falt2"
231751 #endif
231752 /* Return the source-id for this library */
231753 SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
231754 /************************** End of sqlite3.c ******************************/
231755
+4 -4
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123123
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124124
** [sqlite_version()] and [sqlite_source_id()].
125125
*/
126126
#define SQLITE_VERSION "3.34.0"
127127
#define SQLITE_VERSION_NUMBER 3034000
128
-#define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020"
128
+#define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
129129
130130
/*
131131
** CAPI3REF: Run-Time Library Version Numbers
132132
** KEYWORDS: sqlite3_version sqlite3_sourceid
133133
**
@@ -6191,11 +6191,11 @@
61916191
** CAPI3REF: Determine the transaction state of a database
61926192
** METHOD: sqlite3
61936193
**
61946194
** ^The sqlite3_txn_state(D,S) interface returns the current
61956195
** [transaction state] of schema S in database connection D. ^If S is NULL,
6196
-** then the highest transaction state of any schema on databse connection D
6196
+** then the highest transaction state of any schema on database connection D
61976197
** is returned. Transaction states are (in order of lowest to highest):
61986198
** <ol>
61996199
** <li value="0"> SQLITE_TXN_NONE
62006200
** <li value="1"> SQLITE_TXN_READ
62016201
** <li value="2"> SQLITE_TXN_WRITE
@@ -7738,11 +7738,10 @@
77387738
*/
77397739
#define SQLITE_TESTCTRL_FIRST 5
77407740
#define SQLITE_TESTCTRL_PRNG_SAVE 5
77417741
#define SQLITE_TESTCTRL_PRNG_RESTORE 6
77427742
#define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
7743
-#define SQLITE_TESTCTRL_SEEK_COUNT 7
77447743
#define SQLITE_TESTCTRL_BITVEC_TEST 8
77457744
#define SQLITE_TESTCTRL_FAULT_INSTALL 9
77467745
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
77477746
#define SQLITE_TESTCTRL_PENDING_BYTE 11
77487747
#define SQLITE_TESTCTRL_ASSERT 12
@@ -7763,11 +7762,12 @@
77637762
#define SQLITE_TESTCTRL_IMPOSTER 25
77647763
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
77657764
#define SQLITE_TESTCTRL_RESULT_INTREAL 27
77667765
#define SQLITE_TESTCTRL_PRNG_SEED 28
77677766
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
7768
-#define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
7767
+#define SQLITE_TESTCTRL_SEEK_COUNT 30
7768
+#define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
77697769
77707770
/*
77717771
** CAPI3REF: SQL Keyword Checking
77727772
**
77737773
** These routines provide access to the set of SQL language keywords
77747774
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.34.0"
127 #define SQLITE_VERSION_NUMBER 3034000
128 #define SQLITE_SOURCE_ID "2020-11-23 21:05:29 4f1573b146193e5d552981a9d1d11e50da4da4a843f790e4af1cf0cc19a0b020"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -6191,11 +6191,11 @@
6191 ** CAPI3REF: Determine the transaction state of a database
6192 ** METHOD: sqlite3
6193 **
6194 ** ^The sqlite3_txn_state(D,S) interface returns the current
6195 ** [transaction state] of schema S in database connection D. ^If S is NULL,
6196 ** then the highest transaction state of any schema on databse connection D
6197 ** is returned. Transaction states are (in order of lowest to highest):
6198 ** <ol>
6199 ** <li value="0"> SQLITE_TXN_NONE
6200 ** <li value="1"> SQLITE_TXN_READ
6201 ** <li value="2"> SQLITE_TXN_WRITE
@@ -7738,11 +7738,10 @@
7738 */
7739 #define SQLITE_TESTCTRL_FIRST 5
7740 #define SQLITE_TESTCTRL_PRNG_SAVE 5
7741 #define SQLITE_TESTCTRL_PRNG_RESTORE 6
7742 #define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
7743 #define SQLITE_TESTCTRL_SEEK_COUNT 7
7744 #define SQLITE_TESTCTRL_BITVEC_TEST 8
7745 #define SQLITE_TESTCTRL_FAULT_INSTALL 9
7746 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
7747 #define SQLITE_TESTCTRL_PENDING_BYTE 11
7748 #define SQLITE_TESTCTRL_ASSERT 12
@@ -7763,11 +7762,12 @@
7763 #define SQLITE_TESTCTRL_IMPOSTER 25
7764 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
7765 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
7766 #define SQLITE_TESTCTRL_PRNG_SEED 28
7767 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
7768 #define SQLITE_TESTCTRL_LAST 29 /* Largest TESTCTRL */
 
7769
7770 /*
7771 ** CAPI3REF: SQL Keyword Checking
7772 **
7773 ** These routines provide access to the set of SQL language keywords
7774
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -123,11 +123,11 @@
123 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
124 ** [sqlite_version()] and [sqlite_source_id()].
125 */
126 #define SQLITE_VERSION "3.34.0"
127 #define SQLITE_VERSION_NUMBER 3034000
128 #define SQLITE_SOURCE_ID "2020-12-01 16:14:00 a26b6597e3ae272231b96f9982c3bcc17ddec2f2b6eb4df06a224b91089fed5b"
129
130 /*
131 ** CAPI3REF: Run-Time Library Version Numbers
132 ** KEYWORDS: sqlite3_version sqlite3_sourceid
133 **
@@ -6191,11 +6191,11 @@
6191 ** CAPI3REF: Determine the transaction state of a database
6192 ** METHOD: sqlite3
6193 **
6194 ** ^The sqlite3_txn_state(D,S) interface returns the current
6195 ** [transaction state] of schema S in database connection D. ^If S is NULL,
6196 ** then the highest transaction state of any schema on database connection D
6197 ** is returned. Transaction states are (in order of lowest to highest):
6198 ** <ol>
6199 ** <li value="0"> SQLITE_TXN_NONE
6200 ** <li value="1"> SQLITE_TXN_READ
6201 ** <li value="2"> SQLITE_TXN_WRITE
@@ -7738,11 +7738,10 @@
7738 */
7739 #define SQLITE_TESTCTRL_FIRST 5
7740 #define SQLITE_TESTCTRL_PRNG_SAVE 5
7741 #define SQLITE_TESTCTRL_PRNG_RESTORE 6
7742 #define SQLITE_TESTCTRL_PRNG_RESET 7 /* NOT USED */
 
7743 #define SQLITE_TESTCTRL_BITVEC_TEST 8
7744 #define SQLITE_TESTCTRL_FAULT_INSTALL 9
7745 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10
7746 #define SQLITE_TESTCTRL_PENDING_BYTE 11
7747 #define SQLITE_TESTCTRL_ASSERT 12
@@ -7763,11 +7762,12 @@
7762 #define SQLITE_TESTCTRL_IMPOSTER 25
7763 #define SQLITE_TESTCTRL_PARSER_COVERAGE 26
7764 #define SQLITE_TESTCTRL_RESULT_INTREAL 27
7765 #define SQLITE_TESTCTRL_PRNG_SEED 28
7766 #define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS 29
7767 #define SQLITE_TESTCTRL_SEEK_COUNT 30
7768 #define SQLITE_TESTCTRL_LAST 30 /* Largest TESTCTRL */
7769
7770 /*
7771 ** CAPI3REF: SQL Keyword Checking
7772 **
7773 ** These routines provide access to the set of SQL language keywords
7774

Keyboard Shortcuts

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