diff options
author | drh <> | 2022-04-18 00:57:11 +0000 |
---|---|---|
committer | drh <> | 2022-04-18 00:57:11 +0000 |
commit | 79a25ee0215401931c33b0c2630e2523c53f445d (patch) | |
tree | 70ce6e07d0199956ab60dcb0d5a0c2e5ce17fcc6 /src/resolve.c | |
parent | d0453f7ec53693c32b058909ebb3d954ffe0c054 (diff) | |
download | sqlite-79a25ee0215401931c33b0c2630e2523c53f445d.tar.gz sqlite-79a25ee0215401931c33b0c2630e2523c53f445d.zip |
Fix to the coalesce() function generation in the resolver.
FossilOrigin-Name: 584bd55e20669d09b7efe3429ba847c42c32fb1eb960784c4e0dedcd96899313
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/resolve.c b/src/resolve.c index d114dfc46..76e635acf 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -205,11 +205,9 @@ static void extendFJMatch( ){ Expr *pNew = sqlite3ExprAlloc(pParse->db, TK_COLUMN, 0, 0); if( pNew ){ - Table *pTab; pNew->iTable = pMatch->iCursor; - assert( ExprUseYTab(pNew) ); - pTab = pNew->y.pTab = pMatch->pTab; - pNew->iColumn = iColumn==pTab->iPKey ? -1 : iColumn; + pNew->iColumn = iColumn; + pNew->y.pTab = pMatch->pTab; assert( (pMatch->fg.jointype & (JT_LEFT|JT_LTORJ))!=0 ); ExprSetProperty(pNew, EP_CanBeNull); *ppList = sqlite3ExprListAppend(pParse, *ppList, pNew); @@ -342,7 +340,7 @@ static int lookupName( pFJMatch = 0; }else{ /* For a FULL JOIN, we must construct a coalesce() func */ - extendFJMatch(pParse, &pFJMatch, pMatch, j); + extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn); } } cnt++; @@ -396,7 +394,7 @@ static int lookupName( pFJMatch = 0; }else{ /* For a FULL JOIN, we must construct a coalesce() func */ - extendFJMatch(pParse, &pFJMatch, pMatch, j); + extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn); } } cnt++; |