Fossil SCM

Update SQLite from upstream so that Fossil will compile on pre-C99 compilers. This SQLite still has issues with ORDER BY optimization, but those issues do not seem to effect Fossil.

drh 2012-10-05 13:48 trunk
Commit 5a428febd486a69c14a1e1687b2a99ea0e805597
2 files changed +4 -3 +1 -1
+4 -3
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -673,11 +673,11 @@
673673
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
674674
** [sqlite_version()] and [sqlite_source_id()].
675675
*/
676676
#define SQLITE_VERSION "3.7.15"
677677
#define SQLITE_VERSION_NUMBER 3007015
678
-#define SQLITE_SOURCE_ID "2012-10-03 12:56:18 956e4d7f8958e7065ff2d61cd71519d6f4113d4a"
678
+#define SQLITE_SOURCE_ID "2012-10-05 07:36:34 43155b1543bddbb84a8bc13a5b7344b228ddacb9"
679679
680680
/*
681681
** CAPI3REF: Run-Time Library Version Numbers
682682
** KEYWORDS: sqlite3_version, sqlite3_sourceid
683683
**
@@ -104996,11 +104996,10 @@
104996104996
for(; pProbe; pIdx=pProbe=pProbe->pNext){
104997104997
const tRowcnt * const aiRowEst = pProbe->aiRowEst;
104998104998
WhereCost pc; /* Cost of using pProbe */
104999104999
double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */
105000105000
int bRev = 2; /* 0=forward scan. 1=reverse. 2=undecided */
105001
- memset(&pc, 0, sizeof(pc));
105002105001
105003105002
/* The following variables are populated based on the properties of
105004105003
** index being evaluated. They are then used to determine the expected
105005105004
** cost and number of rows returned.
105006105005
**
@@ -105083,10 +105082,11 @@
105083105082
WhereTerm *pTerm; /* A single term of the WHERE clause */
105084105083
#ifdef SQLITE_ENABLE_STAT3
105085105084
WhereTerm *pFirstTerm = 0; /* First term matching the index */
105086105085
#endif
105087105086
105087
+ memset(&pc, 0, sizeof(pc));
105088105088
nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0;
105089105089
if( p->i ){
105090105090
nPriorSat = pc.plan.nOBSat = p->aLevel[p->i-1].plan.nOBSat;
105091105091
bSort = nPriorSat<nOrderBy;
105092105092
bDist = 0;
@@ -105115,11 +105115,12 @@
105115105115
nInMul *= pExpr->x.pList->nExpr;
105116105116
}
105117105117
}else if( pTerm->eOperator & WO_ISNULL ){
105118105118
pc.plan.wsFlags |= WHERE_COLUMN_NULL;
105119105119
if( pc.plan.nEq==nOrdered ) nOrdered++;
105120
- }else if( bSort && pc.plan.nEq==nOrdered && isOrderedTerm(p, pTerm, &bRev) ){
105120
+ }else if( bSort && pc.plan.nEq==nOrdered
105121
+ && isOrderedTerm(p,pTerm,&bRev) ){
105121105122
nOrdered++;
105122105123
}
105123105124
#ifdef SQLITE_ENABLE_STAT3
105124105125
if( pc.plan.nEq==0 && pProbe->aSample ) pFirstTerm = pTerm;
105125105126
#endif
105126105127
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -673,11 +673,11 @@
673 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
674 ** [sqlite_version()] and [sqlite_source_id()].
675 */
676 #define SQLITE_VERSION "3.7.15"
677 #define SQLITE_VERSION_NUMBER 3007015
678 #define SQLITE_SOURCE_ID "2012-10-03 12:56:18 956e4d7f8958e7065ff2d61cd71519d6f4113d4a"
679
680 /*
681 ** CAPI3REF: Run-Time Library Version Numbers
682 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
683 **
@@ -104996,11 +104996,10 @@
104996 for(; pProbe; pIdx=pProbe=pProbe->pNext){
104997 const tRowcnt * const aiRowEst = pProbe->aiRowEst;
104998 WhereCost pc; /* Cost of using pProbe */
104999 double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */
105000 int bRev = 2; /* 0=forward scan. 1=reverse. 2=undecided */
105001 memset(&pc, 0, sizeof(pc));
105002
105003 /* The following variables are populated based on the properties of
105004 ** index being evaluated. They are then used to determine the expected
105005 ** cost and number of rows returned.
105006 **
@@ -105083,10 +105082,11 @@
105083 WhereTerm *pTerm; /* A single term of the WHERE clause */
105084 #ifdef SQLITE_ENABLE_STAT3
105085 WhereTerm *pFirstTerm = 0; /* First term matching the index */
105086 #endif
105087
 
105088 nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0;
105089 if( p->i ){
105090 nPriorSat = pc.plan.nOBSat = p->aLevel[p->i-1].plan.nOBSat;
105091 bSort = nPriorSat<nOrderBy;
105092 bDist = 0;
@@ -105115,11 +105115,12 @@
105115 nInMul *= pExpr->x.pList->nExpr;
105116 }
105117 }else if( pTerm->eOperator & WO_ISNULL ){
105118 pc.plan.wsFlags |= WHERE_COLUMN_NULL;
105119 if( pc.plan.nEq==nOrdered ) nOrdered++;
105120 }else if( bSort && pc.plan.nEq==nOrdered && isOrderedTerm(p, pTerm, &bRev) ){
 
105121 nOrdered++;
105122 }
105123 #ifdef SQLITE_ENABLE_STAT3
105124 if( pc.plan.nEq==0 && pProbe->aSample ) pFirstTerm = pTerm;
105125 #endif
105126
--- src/sqlite3.c
+++ src/sqlite3.c
@@ -673,11 +673,11 @@
673 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
674 ** [sqlite_version()] and [sqlite_source_id()].
675 */
676 #define SQLITE_VERSION "3.7.15"
677 #define SQLITE_VERSION_NUMBER 3007015
678 #define SQLITE_SOURCE_ID "2012-10-05 07:36:34 43155b1543bddbb84a8bc13a5b7344b228ddacb9"
679
680 /*
681 ** CAPI3REF: Run-Time Library Version Numbers
682 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
683 **
@@ -104996,11 +104996,10 @@
104996 for(; pProbe; pIdx=pProbe=pProbe->pNext){
104997 const tRowcnt * const aiRowEst = pProbe->aiRowEst;
104998 WhereCost pc; /* Cost of using pProbe */
104999 double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */
105000 int bRev = 2; /* 0=forward scan. 1=reverse. 2=undecided */
 
105001
105002 /* The following variables are populated based on the properties of
105003 ** index being evaluated. They are then used to determine the expected
105004 ** cost and number of rows returned.
105005 **
@@ -105083,10 +105082,11 @@
105082 WhereTerm *pTerm; /* A single term of the WHERE clause */
105083 #ifdef SQLITE_ENABLE_STAT3
105084 WhereTerm *pFirstTerm = 0; /* First term matching the index */
105085 #endif
105086
105087 memset(&pc, 0, sizeof(pc));
105088 nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0;
105089 if( p->i ){
105090 nPriorSat = pc.plan.nOBSat = p->aLevel[p->i-1].plan.nOBSat;
105091 bSort = nPriorSat<nOrderBy;
105092 bDist = 0;
@@ -105115,11 +105115,12 @@
105115 nInMul *= pExpr->x.pList->nExpr;
105116 }
105117 }else if( pTerm->eOperator & WO_ISNULL ){
105118 pc.plan.wsFlags |= WHERE_COLUMN_NULL;
105119 if( pc.plan.nEq==nOrdered ) nOrdered++;
105120 }else if( bSort && pc.plan.nEq==nOrdered
105121 && isOrderedTerm(p,pTerm,&bRev) ){
105122 nOrdered++;
105123 }
105124 #ifdef SQLITE_ENABLE_STAT3
105125 if( pc.plan.nEq==0 && pProbe->aSample ) pFirstTerm = pTerm;
105126 #endif
105127
+1 -1
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107107
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108108
** [sqlite_version()] and [sqlite_source_id()].
109109
*/
110110
#define SQLITE_VERSION "3.7.15"
111111
#define SQLITE_VERSION_NUMBER 3007015
112
-#define SQLITE_SOURCE_ID "2012-10-03 12:56:18 956e4d7f8958e7065ff2d61cd71519d6f4113d4a"
112
+#define SQLITE_SOURCE_ID "2012-10-05 07:36:34 43155b1543bddbb84a8bc13a5b7344b228ddacb9"
113113
114114
/*
115115
** CAPI3REF: Run-Time Library Version Numbers
116116
** KEYWORDS: sqlite3_version, sqlite3_sourceid
117117
**
118118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.15"
111 #define SQLITE_VERSION_NUMBER 3007015
112 #define SQLITE_SOURCE_ID "2012-10-03 12:56:18 956e4d7f8958e7065ff2d61cd71519d6f4113d4a"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118
--- src/sqlite3.h
+++ src/sqlite3.h
@@ -107,11 +107,11 @@
107 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
108 ** [sqlite_version()] and [sqlite_source_id()].
109 */
110 #define SQLITE_VERSION "3.7.15"
111 #define SQLITE_VERSION_NUMBER 3007015
112 #define SQLITE_SOURCE_ID "2012-10-05 07:36:34 43155b1543bddbb84a8bc13a5b7344b228ddacb9"
113
114 /*
115 ** CAPI3REF: Run-Time Library Version Numbers
116 ** KEYWORDS: sqlite3_version, sqlite3_sourceid
117 **
118

Keyboard Shortcuts

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