diff options
author | drh <> | 2022-04-13 12:34:54 +0000 |
---|---|---|
committer | drh <> | 2022-04-13 12:34:54 +0000 |
commit | 94e615a6acf3a1519d98e85a6665c712edb5ea8a (patch) | |
tree | e163e2a1f8ce85dbbcbe67a247b103f689c5f85d /src/whereexpr.c | |
parent | 3b79f7580a30e7a49962e9a2538498c65227a4d7 (diff) | |
parent | 12c35ec322dc2b394a3a6d8b3997ef60574414a0 (diff) | |
download | sqlite-94e615a6acf3a1519d98e85a6665c712edb5ea8a.tar.gz sqlite-94e615a6acf3a1519d98e85a6665c712edb5ea8a.zip |
Add support for RIGHT and FULL OUTER JOINs.
FossilOrigin-Name: fa9d206f904280e3eafc6f4ba6c0c7325948364c62eeeb9f0fdc5825d622ec35
Diffstat (limited to 'src/whereexpr.c')
-rw-r--r-- | src/whereexpr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/whereexpr.c b/src/whereexpr.c index adcb90d0b..90c344806 100644 --- a/src/whereexpr.c +++ b/src/whereexpr.c @@ -1809,6 +1809,7 @@ void sqlite3WhereTabFuncArgs( if( pArgs==0 ) return; for(j=k=0; j<pArgs->nExpr; j++){ Expr *pRhs; + u32 joinType; while( k<pTab->nCol && (pTab->aCol[k].colFlags & COLFLAG_HIDDEN)==0 ){k++;} if( k>=pTab->nCol ){ sqlite3ErrorMsg(pParse, "too many arguments on %s() - max %d", @@ -1825,9 +1826,12 @@ void sqlite3WhereTabFuncArgs( pRhs = sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprDup(pParse->db, pArgs->a[j].pExpr, 0), 0); pTerm = sqlite3PExpr(pParse, TK_EQ, pColRef, pRhs); - if( pItem->fg.jointype & JT_LEFT ){ - sqlite3SetJoinExpr(pTerm, pItem->iCursor); + if( pItem->fg.jointype & (JT_LEFT|JT_LTORJ) ){ + joinType = EP_FromJoin; + }else{ + joinType = EP_InnerJoin; } + sqlite3SetJoinExpr(pTerm, pItem->iCursor, joinType); whereClauseInsert(pWC, pTerm, TERM_DYNAMIC); } } |