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.
Commit
5a428febd486a69c14a1e1687b2a99ea0e805597
Parent
eec11147cf1570c…
2 files changed
+4
-3
+1
-1
+4
-3
| --- src/sqlite3.c | ||
| +++ src/sqlite3.c | ||
| @@ -673,11 +673,11 @@ | ||
| 673 | 673 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 674 | 674 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 675 | 675 | */ |
| 676 | 676 | #define SQLITE_VERSION "3.7.15" |
| 677 | 677 | #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" | |
| 679 | 679 | |
| 680 | 680 | /* |
| 681 | 681 | ** CAPI3REF: Run-Time Library Version Numbers |
| 682 | 682 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 683 | 683 | ** |
| @@ -104996,11 +104996,10 @@ | ||
| 104996 | 104996 | for(; pProbe; pIdx=pProbe=pProbe->pNext){ |
| 104997 | 104997 | const tRowcnt * const aiRowEst = pProbe->aiRowEst; |
| 104998 | 104998 | WhereCost pc; /* Cost of using pProbe */ |
| 104999 | 104999 | double log10N = (double)1; /* base-10 logarithm of nRow (inexact) */ |
| 105000 | 105000 | int bRev = 2; /* 0=forward scan. 1=reverse. 2=undecided */ |
| 105001 | - memset(&pc, 0, sizeof(pc)); | |
| 105002 | 105001 | |
| 105003 | 105002 | /* The following variables are populated based on the properties of |
| 105004 | 105003 | ** index being evaluated. They are then used to determine the expected |
| 105005 | 105004 | ** cost and number of rows returned. |
| 105006 | 105005 | ** |
| @@ -105083,10 +105082,11 @@ | ||
| 105083 | 105082 | WhereTerm *pTerm; /* A single term of the WHERE clause */ |
| 105084 | 105083 | #ifdef SQLITE_ENABLE_STAT3 |
| 105085 | 105084 | WhereTerm *pFirstTerm = 0; /* First term matching the index */ |
| 105086 | 105085 | #endif |
| 105087 | 105086 | |
| 105087 | + memset(&pc, 0, sizeof(pc)); | |
| 105088 | 105088 | nOrderBy = p->pOrderBy ? p->pOrderBy->nExpr : 0; |
| 105089 | 105089 | if( p->i ){ |
| 105090 | 105090 | nPriorSat = pc.plan.nOBSat = p->aLevel[p->i-1].plan.nOBSat; |
| 105091 | 105091 | bSort = nPriorSat<nOrderBy; |
| 105092 | 105092 | bDist = 0; |
| @@ -105115,11 +105115,12 @@ | ||
| 105115 | 105115 | nInMul *= pExpr->x.pList->nExpr; |
| 105116 | 105116 | } |
| 105117 | 105117 | }else if( pTerm->eOperator & WO_ISNULL ){ |
| 105118 | 105118 | pc.plan.wsFlags |= WHERE_COLUMN_NULL; |
| 105119 | 105119 | 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) ){ | |
| 105121 | 105122 | nOrdered++; |
| 105122 | 105123 | } |
| 105123 | 105124 | #ifdef SQLITE_ENABLE_STAT3 |
| 105124 | 105125 | if( pc.plan.nEq==0 && pProbe->aSample ) pFirstTerm = pTerm; |
| 105125 | 105126 | #endif |
| 105126 | 105127 |
| --- 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 @@ | ||
| 107 | 107 | ** [sqlite3_libversion_number()], [sqlite3_sourceid()], |
| 108 | 108 | ** [sqlite_version()] and [sqlite_source_id()]. |
| 109 | 109 | */ |
| 110 | 110 | #define SQLITE_VERSION "3.7.15" |
| 111 | 111 | #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" | |
| 113 | 113 | |
| 114 | 114 | /* |
| 115 | 115 | ** CAPI3REF: Run-Time Library Version Numbers |
| 116 | 116 | ** KEYWORDS: sqlite3_version, sqlite3_sourceid |
| 117 | 117 | ** |
| 118 | 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-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 |