diff options
author | dan <Dan Kennedy> | 2024-12-03 19:30:14 +0000 |
---|---|---|
committer | dan <Dan Kennedy> | 2024-12-03 19:30:14 +0000 |
commit | c99caf5de509c664dee74e5fcd2b77befe59f67f (patch) | |
tree | 89bd55fe084d297506fe0f2c882639d33215f8fe /src/select.c | |
parent | 2d5ce92aae630c540a62c6c6dc89b9ca1625aa60 (diff) | |
parent | 33c120f9b7de84fb0dd2625efe11097015c0e116 (diff) | |
download | sqlite-c99caf5de509c664dee74e5fcd2b77befe59f67f.tar.gz sqlite-c99caf5de509c664dee74e5fcd2b77befe59f67f.zip |
Merge latest trunk into this branch.
FossilOrigin-Name: eb13b8b3ef67ca8a252f7a4fd5a83ed31fefe68aa5ad8693d9d1f17218f4d176
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/select.c b/src/select.c index 9fcf30ff4..285e9133e 100644 --- a/src/select.c +++ b/src/select.c @@ -3911,32 +3911,32 @@ static Expr *substExpr( if( pSubst->isOuterJoin ){ ExprSetProperty(pNew, EP_CanBeNull); } - if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){ - sqlite3SetJoinExpr(pNew, pExpr->w.iJoin, - pExpr->flags & (EP_OuterON|EP_InnerON)); - } - sqlite3ExprDelete(db, pExpr); - pExpr = pNew; - if( pExpr->op==TK_TRUEFALSE ){ - pExpr->u.iValue = sqlite3ExprTruthValue(pExpr); - pExpr->op = TK_INTEGER; - ExprSetProperty(pExpr, EP_IntValue); + if( pNew->op==TK_TRUEFALSE ){ + pNew->u.iValue = sqlite3ExprTruthValue(pNew); + pNew->op = TK_INTEGER; + ExprSetProperty(pNew, EP_IntValue); } /* Ensure that the expression now has an implicit collation sequence, ** just as it did when it was a column of a view or sub-query. */ { - CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pExpr); + CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pNew); CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse, pSubst->pCList->a[iColumn].pExpr ); - if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){ - pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr, + if( pNat!=pColl || (pNew->op!=TK_COLUMN && pNew->op!=TK_COLLATE) ){ + pNew = sqlite3ExprAddCollateString(pSubst->pParse, pNew, (pColl ? pColl->zName : "BINARY") ); } } - ExprClearProperty(pExpr, EP_Collate); + ExprClearProperty(pNew, EP_Collate); + if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){ + sqlite3SetJoinExpr(pNew, pExpr->w.iJoin, + pExpr->flags & (EP_OuterON|EP_InnerON)); + } + sqlite3ExprDelete(db, pExpr); + pExpr = pNew; } } }else{ @@ -7821,7 +7821,7 @@ int sqlite3Select( #endif assert( pSubq->pSelect && (pSub->selFlags & SF_PushDown)!=0 ); }else{ - TREETRACE(0x4000,pParse,p,("WHERE-lcause push-down not possible\n")); + TREETRACE(0x4000,pParse,p,("WHERE-clause push-down not possible\n")); } /* Convert unused result columns of the subquery into simple NULL |