Avoid omitting the rhs of FULL JOINs in cases where it is only correct to omit the rhs of a LEFT JOIN.

FossilOrigin-Name: f23a429d4153518d37387e121f22a30b22e2b31e126ad168e72049a96be86269
This commit is contained in:
dan
2022-06-17 11:39:24 +00:00
parent 3e245bcef3
commit 2a7aff93ed
4 changed files with 67 additions and 9 deletions
+1 -1
View File
@@ -5246,7 +5246,7 @@ static SQLITE_NOINLINE Bitmask whereOmitNoopJoin(
WhereLoop *pLoop;
pLoop = pWInfo->a[i].pWLoop;
pItem = &pWInfo->pTabList->a[pLoop->iTab];
if( (pItem->fg.jointype & JT_LEFT)==0 ) continue;
if( (pItem->fg.jointype & (JT_LEFT|JT_RIGHT))!=JT_LEFT ) continue;
if( (pWInfo->wctrlFlags & WHERE_WANT_DISTINCT)==0
&& (pLoop->wsFlags & WHERE_ONEROW)==0
){