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

Fix a potential reference off the end of an array in the query planner.

FossilOrigin-Name: f15591f80212dd6d4ed8e0f14be691cd578d4cdf
This commit is contained in:
drh
2013-08-19 14:19:00 +00:00
parent 77dfd5bb44
commit 9e48788e9d
3 changed files with 10 additions and 8 deletions

View File

@@ -4337,7 +4337,9 @@ static int whereLoopAddBtreeIndex(
int nIn = 0;
if( pTerm->prereqRight & pNew->maskSelf ) continue;
#ifdef SQLITE_ENABLE_STAT3
if( (pTerm->wtFlags & TERM_VNULL)!=0 && pSrc->pTab->aCol[iCol].notNull ){
if( (pTerm->wtFlags & TERM_VNULL)!=0
&& (iCol<0 || pSrc->pTab->aCol[iCol].notNull)
){
continue; /* skip IS NOT NULL constraints on a NOT NULL column */
}
#endif