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

Fix the query flattener to deal with a RIGHT JOIN corner case described

by [forum:/forumpost/323f86cc30|forum post 323f86cc30].

FossilOrigin-Name: 3f45007d544e5f787d5837b4d9f484ba473d69cdba83c229228e9c2f6b972b75
This commit is contained in:
drh
2022-06-07 13:09:58 +00:00
parent bb1369037b
commit 33b2cb9aec
4 changed files with 10 additions and 11 deletions

View File

@@ -3763,9 +3763,10 @@ static Expr *substExpr(
Expr *pExpr /* Expr in which substitution occurs */
){
if( pExpr==0 ) return 0;
if( ExprHasProperty(pExpr, EP_OuterON)
if( ExprHasProperty(pExpr, EP_OuterON|EP_InnerON)
&& pExpr->w.iJoin==pSubst->iTable
){
testcase( ExprHasProperty(pExpr, EP_InnerON) );
pExpr->w.iJoin = pSubst->iNewTable;
}
if( pExpr->op==TK_COLUMN