1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-19 21:43:15 +03:00

Fix a problem computing affinities for indexes during skip-scan code

generation when SQLITE_ENABLE_STAT4 is on.  Bug introduced by
check-in [1ee089a72d789002].

FossilOrigin-Name: 1350dd42d056508337b1a07ad8b1c9c97593f8d3
This commit is contained in:
drh
2015-09-25 01:09:27 +00:00
parent dae26fe518
commit 8ffddeb708
3 changed files with 9 additions and 9 deletions

View File

@@ -1159,6 +1159,7 @@ static LogEst whereRangeAdjust(WhereTerm *pTerm, LogEst nNew){
** Return the affinity for a single column of an index.
*/
static char sqlite3IndexColumnAffinity(sqlite3 *db, Index *pIdx, int iCol){
assert( iCol>=0 && iCol<pIdx->nColumn );
if( !pIdx->zColAff ){
if( sqlite3IndexAffinityStr(db, pIdx)==0 ) return SQLITE_AFF_BLOB;
}
@@ -1216,8 +1217,7 @@ static int whereRangeSkipScanEst(
int nLower = -1;
int nUpper = p->nSample+1;
int rc = SQLITE_OK;
int iCol = p->aiColumn[nEq];
u8 aff = sqlite3IndexColumnAffinity(db, p, iCol);
u8 aff = sqlite3IndexColumnAffinity(db, p, nEq);
CollSeq *pColl;
sqlite3_value *p1 = 0; /* Value extracted from pLower */