Fossil SCM

Update the built-in SQLite to 3.14.1 release

jan.nijtmans 2016-08-12 13:33 trunk
Commit f80532e92c938304dc67c8b917d7ff39b58c4f45
+32 -12
--- 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.14.0. By combining all the individual C code files into this
3
+** version 3.14.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.
@@ -378,13 +378,13 @@
378378
**
379379
** See also: [sqlite3_libversion()],
380380
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381381
** [sqlite_version()] and [sqlite_source_id()].
382382
*/
383
-#define SQLITE_VERSION "3.14.0"
384
-#define SQLITE_VERSION_NUMBER 3014000
385
-#define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
383
+#define SQLITE_VERSION "3.14.1"
384
+#define SQLITE_VERSION_NUMBER 3014001
385
+#define SQLITE_SOURCE_ID "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
386386
387387
/*
388388
** CAPI3REF: Run-Time Library Version Numbers
389389
** KEYWORDS: sqlite3_version, sqlite3_sourceid
390390
**
@@ -44996,29 +44996,49 @@
4499644996
*/
4499744997
static void pcache1TruncateUnsafe(
4499844998
PCache1 *pCache, /* The cache to truncate */
4499944999
unsigned int iLimit /* Drop pages with this pgno or larger */
4500045000
){
45001
- TESTONLY( unsigned int nPage = 0; ) /* To assert pCache->nPage is correct */
45002
- unsigned int h;
45001
+ TESTONLY( int nPage = 0; ) /* To assert pCache->nPage is correct */
45002
+ unsigned int h, iStop;
4500345003
assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
45004
- for(h=0; h<pCache->nHash; h++){
45005
- PgHdr1 **pp = &pCache->apHash[h];
45004
+ assert( pCache->iMaxKey >= iLimit );
45005
+ assert( pCache->nHash > 0 );
45006
+ if( pCache->iMaxKey - iLimit < pCache->nHash ){
45007
+ /* If we are just shaving the last few pages off the end of the
45008
+ ** cache, then there is no point in scanning the entire hash table.
45009
+ ** Only scan those hash slots that might contain pages that need to
45010
+ ** be removed. */
45011
+ h = iLimit % pCache->nHash;
45012
+ iStop = pCache->iMaxKey % pCache->nHash;
45013
+ TESTONLY( nPage = -10; ) /* Disable the pCache->nPage validity check */
45014
+ }else{
45015
+ /* This is the general case where many pages are being removed.
45016
+ ** It is necessary to scan the entire hash table */
45017
+ h = pCache->nHash/2;
45018
+ iStop = h - 1;
45019
+ }
45020
+ for(;;){
45021
+ PgHdr1 **pp;
4500645022
PgHdr1 *pPage;
45023
+ assert( h<pCache->nHash );
45024
+ pp = &pCache->apHash[h];
4500745025
while( (pPage = *pp)!=0 ){
4500845026
if( pPage->iKey>=iLimit ){
4500945027
pCache->nPage--;
4501045028
*pp = pPage->pNext;
4501145029
if( !pPage->isPinned ) pcache1PinPage(pPage);
4501245030
pcache1FreePage(pPage);
4501345031
}else{
4501445032
pp = &pPage->pNext;
45015
- TESTONLY( nPage++; )
45033
+ TESTONLY( if( nPage>=0 ) nPage++; )
4501645034
}
4501745035
}
45036
+ if( h==iStop ) break;
45037
+ h = (h+1) % pCache->nHash;
4501845038
}
45019
- assert( pCache->nPage==nPage );
45039
+ assert( nPage<0 || pCache->nPage==(unsigned)nPage );
4502045040
}
4502145041
4502245042
/******************************************************************************/
4502345043
/******** sqlite3_pcache Methods **********************************************/
4502445044
@@ -45491,11 +45511,11 @@
4549145511
static void pcache1Destroy(sqlite3_pcache *p){
4549245512
PCache1 *pCache = (PCache1 *)p;
4549345513
PGroup *pGroup = pCache->pGroup;
4549445514
assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) );
4549545515
pcache1EnterMutex(pGroup);
45496
- pcache1TruncateUnsafe(pCache, 0);
45516
+ if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0);
4549745517
assert( pGroup->nMaxPage >= pCache->nMax );
4549845518
pGroup->nMaxPage -= pCache->nMax;
4549945519
assert( pGroup->nMinPage >= pCache->nMin );
4550045520
pGroup->nMinPage -= pCache->nMin;
4550145521
pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
@@ -193998,11 +194018,11 @@
193998194018
int nArg, /* Number of args */
193999194019
sqlite3_value **apUnused /* Function arguments */
194000194020
){
194001194021
assert( nArg==0 );
194002194022
UNUSED_PARAM2(nArg, apUnused);
194003
- sqlite3_result_text(pCtx, "fts5: 2016-08-05 20:54:45 95578898835b933901603bd4d5e063f1219a016f", -1, SQLITE_TRANSIENT);
194023
+ sqlite3_result_text(pCtx, "fts5: 2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b", -1, SQLITE_TRANSIENT);
194004194024
}
194005194025
194006194026
static int fts5Init(sqlite3 *db){
194007194027
static const sqlite3_module fts5Mod = {
194008194028
/* iVersion */ 2,
194009194029
--- 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.14.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.
@@ -378,13 +378,13 @@
378 **
379 ** See also: [sqlite3_libversion()],
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.0"
384 #define SQLITE_VERSION_NUMBER 3014000
385 #define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -44996,29 +44996,49 @@
44996 */
44997 static void pcache1TruncateUnsafe(
44998 PCache1 *pCache, /* The cache to truncate */
44999 unsigned int iLimit /* Drop pages with this pgno or larger */
45000 ){
45001 TESTONLY( unsigned int nPage = 0; ) /* To assert pCache->nPage is correct */
45002 unsigned int h;
45003 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
45004 for(h=0; h<pCache->nHash; h++){
45005 PgHdr1 **pp = &pCache->apHash[h];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45006 PgHdr1 *pPage;
 
 
45007 while( (pPage = *pp)!=0 ){
45008 if( pPage->iKey>=iLimit ){
45009 pCache->nPage--;
45010 *pp = pPage->pNext;
45011 if( !pPage->isPinned ) pcache1PinPage(pPage);
45012 pcache1FreePage(pPage);
45013 }else{
45014 pp = &pPage->pNext;
45015 TESTONLY( nPage++; )
45016 }
45017 }
 
 
45018 }
45019 assert( pCache->nPage==nPage );
45020 }
45021
45022 /******************************************************************************/
45023 /******** sqlite3_pcache Methods **********************************************/
45024
@@ -45491,11 +45511,11 @@
45491 static void pcache1Destroy(sqlite3_pcache *p){
45492 PCache1 *pCache = (PCache1 *)p;
45493 PGroup *pGroup = pCache->pGroup;
45494 assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) );
45495 pcache1EnterMutex(pGroup);
45496 pcache1TruncateUnsafe(pCache, 0);
45497 assert( pGroup->nMaxPage >= pCache->nMax );
45498 pGroup->nMaxPage -= pCache->nMax;
45499 assert( pGroup->nMinPage >= pCache->nMin );
45500 pGroup->nMinPage -= pCache->nMin;
45501 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
@@ -193998,11 +194018,11 @@
193998 int nArg, /* Number of args */
193999 sqlite3_value **apUnused /* Function arguments */
194000 ){
194001 assert( nArg==0 );
194002 UNUSED_PARAM2(nArg, apUnused);
194003 sqlite3_result_text(pCtx, "fts5: 2016-08-05 20:54:45 95578898835b933901603bd4d5e063f1219a016f", -1, SQLITE_TRANSIENT);
194004 }
194005
194006 static int fts5Init(sqlite3 *db){
194007 static const sqlite3_module fts5Mod = {
194008 /* iVersion */ 2,
194009
--- 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.14.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.
@@ -378,13 +378,13 @@
378 **
379 ** See also: [sqlite3_libversion()],
380 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
381 ** [sqlite_version()] and [sqlite_source_id()].
382 */
383 #define SQLITE_VERSION "3.14.1"
384 #define SQLITE_VERSION_NUMBER 3014001
385 #define SQLITE_SOURCE_ID "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
386
387 /*
388 ** CAPI3REF: Run-Time Library Version Numbers
389 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
390 **
@@ -44996,29 +44996,49 @@
44996 */
44997 static void pcache1TruncateUnsafe(
44998 PCache1 *pCache, /* The cache to truncate */
44999 unsigned int iLimit /* Drop pages with this pgno or larger */
45000 ){
45001 TESTONLY( int nPage = 0; ) /* To assert pCache->nPage is correct */
45002 unsigned int h, iStop;
45003 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
45004 assert( pCache->iMaxKey >= iLimit );
45005 assert( pCache->nHash > 0 );
45006 if( pCache->iMaxKey - iLimit < pCache->nHash ){
45007 /* If we are just shaving the last few pages off the end of the
45008 ** cache, then there is no point in scanning the entire hash table.
45009 ** Only scan those hash slots that might contain pages that need to
45010 ** be removed. */
45011 h = iLimit % pCache->nHash;
45012 iStop = pCache->iMaxKey % pCache->nHash;
45013 TESTONLY( nPage = -10; ) /* Disable the pCache->nPage validity check */
45014 }else{
45015 /* This is the general case where many pages are being removed.
45016 ** It is necessary to scan the entire hash table */
45017 h = pCache->nHash/2;
45018 iStop = h - 1;
45019 }
45020 for(;;){
45021 PgHdr1 **pp;
45022 PgHdr1 *pPage;
45023 assert( h<pCache->nHash );
45024 pp = &pCache->apHash[h];
45025 while( (pPage = *pp)!=0 ){
45026 if( pPage->iKey>=iLimit ){
45027 pCache->nPage--;
45028 *pp = pPage->pNext;
45029 if( !pPage->isPinned ) pcache1PinPage(pPage);
45030 pcache1FreePage(pPage);
45031 }else{
45032 pp = &pPage->pNext;
45033 TESTONLY( if( nPage>=0 ) nPage++; )
45034 }
45035 }
45036 if( h==iStop ) break;
45037 h = (h+1) % pCache->nHash;
45038 }
45039 assert( nPage<0 || pCache->nPage==(unsigned)nPage );
45040 }
45041
45042 /******************************************************************************/
45043 /******** sqlite3_pcache Methods **********************************************/
45044
@@ -45491,11 +45511,11 @@
45511 static void pcache1Destroy(sqlite3_pcache *p){
45512 PCache1 *pCache = (PCache1 *)p;
45513 PGroup *pGroup = pCache->pGroup;
45514 assert( pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0) );
45515 pcache1EnterMutex(pGroup);
45516 if( pCache->nPage ) pcache1TruncateUnsafe(pCache, 0);
45517 assert( pGroup->nMaxPage >= pCache->nMax );
45518 pGroup->nMaxPage -= pCache->nMax;
45519 assert( pGroup->nMinPage >= pCache->nMin );
45520 pGroup->nMinPage -= pCache->nMin;
45521 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
@@ -193998,11 +194018,11 @@
194018 int nArg, /* Number of args */
194019 sqlite3_value **apUnused /* Function arguments */
194020 ){
194021 assert( nArg==0 );
194022 UNUSED_PARAM2(nArg, apUnused);
194023 sqlite3_result_text(pCtx, "fts5: 2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b", -1, SQLITE_TRANSIENT);
194024 }
194025
194026 static int fts5Init(sqlite3 *db){
194027 static const sqlite3_module fts5Mod = {
194028 /* iVersion */ 2,
194029
+3 -3
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -118,13 +118,13 @@
118118
**
119119
** See also: [sqlite3_libversion()],
120120
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121121
** [sqlite_version()] and [sqlite_source_id()].
122122
*/
123
-#define SQLITE_VERSION "3.14.0"
124
-#define SQLITE_VERSION_NUMBER 3014000
125
-#define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
123
+#define SQLITE_VERSION "3.14.1"
124
+#define SQLITE_VERSION_NUMBER 3014001
125
+#define SQLITE_SOURCE_ID "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
126126
127127
/*
128128
** CAPI3REF: Run-Time Library Version Numbers
129129
** KEYWORDS: sqlite3_version, sqlite3_sourceid
130130
**
131131
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -118,13 +118,13 @@
118 **
119 ** See also: [sqlite3_libversion()],
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.0"
124 #define SQLITE_VERSION_NUMBER 3014000
125 #define SQLITE_SOURCE_ID "2016-08-08 13:40:27 d5e98057028abcf7217d0d2b2e29bbbcdf09d6de"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
131
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -118,13 +118,13 @@
118 **
119 ** See also: [sqlite3_libversion()],
120 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
121 ** [sqlite_version()] and [sqlite_source_id()].
122 */
123 #define SQLITE_VERSION "3.14.1"
124 #define SQLITE_VERSION_NUMBER 3014001
125 #define SQLITE_SOURCE_ID "2016-08-11 18:53:32 a12d8059770df4bca59e321c266410344242bf7b"
126
127 /*
128 ** CAPI3REF: Run-Time Library Version Numbers
129 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
130 **
131
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,12 +2,12 @@
22
33
<h2>Changes for Version 1.36 (2016-00-00)</h2>
44
55
* Update internal Unicode character tables, used in regular expression
66
handling, from version 8.0 to 9.0.
7
- * Update the built-in SQLite to version 3.14.0. Doesn't work with
8
- earlier SQLite versions any more.
7
+ * Update the built-in SQLite to version 3.14.1. Doesn't work with
8
+ earlier SQLite versions than 3.14.0 any more.
99
1010
<h2>Changes for Version 1.35 (2016-06-14)</h2>
1111
1212
* Enable symlinks by default on all non-Windows platforms.
1313
* Enhance the [/md_rules|Markdown formatting] so that hyperlinks that begin
1414
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,12 +2,12 @@
2
3 <h2>Changes for Version 1.36 (2016-00-00)</h2>
4
5 * Update internal Unicode character tables, used in regular expression
6 handling, from version 8.0 to 9.0.
7 * Update the built-in SQLite to version 3.14.0. Doesn't work with
8 earlier SQLite versions any more.
9
10 <h2>Changes for Version 1.35 (2016-06-14)</h2>
11
12 * Enable symlinks by default on all non-Windows platforms.
13 * Enhance the [/md_rules|Markdown formatting] so that hyperlinks that begin
14
--- www/changes.wiki
+++ www/changes.wiki
@@ -2,12 +2,12 @@
2
3 <h2>Changes for Version 1.36 (2016-00-00)</h2>
4
5 * Update internal Unicode character tables, used in regular expression
6 handling, from version 8.0 to 9.0.
7 * Update the built-in SQLite to version 3.14.1. Doesn't work with
8 earlier SQLite versions than 3.14.0 any more.
9
10 <h2>Changes for Version 1.35 (2016-06-14)</h2>
11
12 * Enable symlinks by default on all non-Windows platforms.
13 * Enhance the [/md_rules|Markdown formatting] so that hyperlinks that begin
14

Keyboard Shortcuts

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