aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2011-04-08 21:35:26 +0000
committerdrh <drh@noemail.net>2011-04-08 21:35:26 +0000
commitea6dc4458b335a4fafd7d736c3e23f2e2e765ef8 (patch)
tree60e76cadc47ad8fd8219ea0167919691c6612fc9 /src
parent1c152101cae48fa2d5f9cc979d1642a7ddde78e8 (diff)
downloadsqlite-ea6dc4458b335a4fafd7d736c3e23f2e2e765ef8.tar.gz
sqlite-ea6dc4458b335a4fafd7d736c3e23f2e2e765ef8.zip
Always make sure the left-hand side of the IS NOT NULL operator is a
smiple column, not a general expression, before applying the IS NOT NULL query optimization. FossilOrigin-Name: 543f75a6abe3aa4f49df43e71a462702d40b3251
Diffstat (limited to 'src')
-rw-r--r--src/where.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 851d59fff..5c6d15836 100644
--- a/src/where.c
+++ b/src/where.c
@@ -1342,7 +1342,10 @@ static void exprAnalyze(
** of the loop. Without the TERM_VNULL flag, the not-null check at
** the start of the loop will prevent any results from being returned.
*/
- if( pExpr->op==TK_NOTNULL && pExpr->pLeft->iColumn>=0 ){
+ if( pExpr->op==TK_NOTNULL
+ && pExpr->pLeft->op==TK_COLUMN
+ && pExpr->pLeft->iColumn>=0
+ ){
Expr *pNewExpr;
Expr *pLeft = pExpr->pLeft;
int idxNew;