diff options
author | drh <drh@noemail.net> | 2016-01-29 16:57:06 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-01-29 16:57:06 +0000 |
commit | 3b83f0cd8f8525672a2631c57cea897f95a13a10 (patch) | |
tree | 921027d61d4ff8497a651ae28620dc45ae82c6a2 /src/wherecode.c | |
parent | 98a4d5a7fa997ddabe04c1352acedfb080d0b506 (diff) | |
download | sqlite-3b83f0cd8f8525672a2631c57cea897f95a13a10.tar.gz sqlite-3b83f0cd8f8525672a2631c57cea897f95a13a10.zip |
Avoid unnecessary WHERE clause term tests when coding a join where one
of the tables contains a OR constraint.
FossilOrigin-Name: ab94603974a0ad5342e5aee27603162652e70492
Diffstat (limited to 'src/wherecode.c')
-rw-r--r-- | src/wherecode.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wherecode.c b/src/wherecode.c index 9d53a20a6..4fd7399ef 100644 --- a/src/wherecode.c +++ b/src/wherecode.c @@ -1401,7 +1401,9 @@ Bitmask sqlite3WhereCodeOneLoopStart( Expr *pExpr = pWC->a[iTerm].pExpr; if( &pWC->a[iTerm] == pTerm ) continue; if( ExprHasProperty(pExpr, EP_FromJoin) ) continue; - if( (pWC->a[iTerm].wtFlags & TERM_VIRTUAL)!=0 ) continue; + testcase( pWC->a[iTerm].wtFlags & TERM_VIRTUAL ); + testcase( pWC->a[iTerm].wtFlags & TERM_CODED ); + if( (pWC->a[iTerm].wtFlags & (TERM_VIRTUAL|TERM_CODED))!=0 ) continue; if( (pWC->a[iTerm].eOperator & WO_ALL)==0 ) continue; testcase( pWC->a[iTerm].wtFlags & TERM_ORINFO ); pExpr = sqlite3ExprDup(db, pExpr, 0); |