diff options
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/select.c b/src/select.c index f2bf3f303..f32db2c2a 100644 --- a/src/select.c +++ b/src/select.c @@ -5119,7 +5119,8 @@ static int pushDownWindowCheck(Parse *pParse, Select *pSubq, Expr *pExpr){ ** ** Without this restriction, the push-down optimization might move ** the ON/USING filter expression from the left side of a RIGHT JOIN -** over to the right side, which leads to incorrect answers. +** over to the right side, which leads to incorrect answers. See +** also restriction (6) in sqlite3ExprIsSingleTableConstraint(). ** ** (10) The inner query is not the right-hand table of a RIGHT JOIN. ** @@ -5204,6 +5205,7 @@ static int pushDownWhereTerms( pWhere = pWhere->pLeft; } +#if 0 /* These checks now done by sqlite3ExprIsSingleTableConstraint() */ if( ExprHasProperty(pWhere, EP_OuterON|EP_InnerON) /* (9a) */ && (pSrcList->a[0].fg.jointype & JT_LTORJ)!=0 /* Fast pre-test of (9c) */ ){ @@ -5221,8 +5223,6 @@ static int pushDownWhereTerms( } } } - -#if 0 /* These checks now done by sqlite3ExprIsSingleTableConstraint() */ if( isLeftJoin && (ExprHasProperty(pWhere,EP_OuterON)==0 || pWhere->w.iJoin!=iCursor) @@ -5236,7 +5236,7 @@ static int pushDownWhereTerms( } #endif - if( sqlite3ExprIsSingleTableConstraint(pWhere, pSrc) ){ + if( sqlite3ExprIsSingleTableConstraint(pWhere, pSrcList, iSrc) ){ nChng++; pSubq->selFlags |= SF_PushDown; while( pSubq ){ |