1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

In the query flattener when substituting expression Y in place of expression X,

if X is marked has having come from an ON or USING clause of a LEFT JOIN, then
be sure that all subexpressions of Y, not just the root node of Y, are
similarly marked.  Otherwise, if Y is an AND operator, it will be split up
during WHERE clause analysis and the subexpressions will not get the special
treatment needed by LEFT JOIN ON/USING clauses.
Fix for ticket [66e4b0e271c47145].

FossilOrigin-Name: 69f9eb7343a416c5ab426c8e1b9f0ae576544b4ccc5d87f5481c8ff884f696e1
This commit is contained in:
drh
2020-09-30 15:36:03 +00:00
parent 1e6c58dee2
commit af3711536b
4 changed files with 24 additions and 12 deletions

View File

@@ -3515,8 +3515,7 @@ static Expr *substExpr(
ExprSetProperty(pNew, EP_CanBeNull);
}
if( pNew && ExprHasProperty(pExpr,EP_FromJoin) ){
pNew->iRightJoinTable = pExpr->iRightJoinTable;
ExprSetProperty(pNew, EP_FromJoin);
sqlite3SetJoinExpr(pNew, pExpr->iRightJoinTable);
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;