1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Avoid clearing the EP_FromJoin flag from terms in ON clauses when flattening

sub-selects. Possible fix for [2df0107b].

FossilOrigin-Name: a427c4052820d90c3c8c23abf9097f973e564010
This commit is contained in:
dan
2016-12-01 19:58:01 +00:00
4 changed files with 43 additions and 11 deletions

View File

@@ -3164,6 +3164,10 @@ static Expr *substExpr(
assert( pEList!=0 && pExpr->iColumn<pEList->nExpr );
assert( pExpr->pLeft==0 && pExpr->pRight==0 );
pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0);
if( pNew && (pExpr->flags & EP_FromJoin) ){
pNew->iRightJoinTable = pExpr->iRightJoinTable;
pNew->flags |= EP_FromJoin;
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
}