aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-07-14 20:23:52 +0000
committerdrh <drh@noemail.net>2010-07-14 20:23:52 +0000
commita7d2db175b05eacc623f8240d1c29335adcf92a9 (patch)
treeca7edc1121d06bb81023dccdf1ce3994c7a1a054 /src
parentef5d9ec166ed7cb60c3de909e91889525db8cc34 (diff)
downloadsqlite-a7d2db175b05eacc623f8240d1c29335adcf92a9.tar.gz
sqlite-a7d2db175b05eacc623f8240d1c29335adcf92a9.zip
The expression list on the RHS of an IN operator can no longer be empty
because an empty expression list is now optimized out by changes in check-in [c288ac644d0bf]. Therefore add ALWAYS() macros around tests for the expression list being non-empty. FossilOrigin-Name: fd130ae56c0e23f2d5b4a82f1a09e89ed7ae1e85
Diffstat (limited to 'src')
-rw-r--r--src/expr.c2
-rw-r--r--src/where.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 8ddf473b2..204643316 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1635,7 +1635,7 @@ int sqlite3CodeSubselect(
keyInfo.aColl[0] = sqlite3BinaryCompareCollSeq(pParse, pExpr->pLeft,
pEList->a[0].pExpr);
}
- }else if( pExpr->x.pList!=0 ){
+ }else if( ALWAYS(pExpr->x.pList!=0) ){
/* Case 2: expr IN (exprlist)
**
** For each expression, build an index key from the evaluation and
diff --git a/src/where.c b/src/where.c
index c53a232a1..b2f75eacd 100644
--- a/src/where.c
+++ b/src/where.c
@@ -2622,7 +2622,7 @@ static void bestBtreeIndex(
if( ExprHasProperty(pExpr, EP_xIsSelect) ){
nInMul *= 25;
bInEst = 1;
- }else if( pExpr->x.pList ){
+ }else if( ALWAYS(pExpr->x.pList) ){
nInMul *= pExpr->x.pList->nExpr + 1;
}
}else if( pTerm->eOperator & WO_ISNULL ){