aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/select.c1
-rw-r--r--src/where.c3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index 665c30933..db41cb493 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7462,6 +7462,7 @@ static SQLITE_NOINLINE void existsToJoin(
if( pSub->pSrc->nSrc==1
&& (pSub->selFlags & SF_Aggregate)==0
&& !pSub->pSrc->a[0].fg.isSubquery
+ && pSub->pLimit==0
){
memset(pWhere, 0, sizeof(*pWhere));
pWhere->op = TK_INTEGER;
diff --git a/src/where.c b/src/where.c
index ab1b419a2..b60c4d1c0 100644
--- a/src/where.c
+++ b/src/where.c
@@ -4037,6 +4037,7 @@ static int whereLoopAddBtree(
pNew->u.btree.nEq = 0;
pNew->u.btree.nBtm = 0;
pNew->u.btree.nTop = 0;
+ pNew->u.btree.nDistinctCol = 0;
pNew->nSkip = 0;
pNew->nLTerm = 0;
pNew->iSortIdx = 0;
@@ -5105,8 +5106,6 @@ static i8 wherePathSatisfiesOrderBy(
obSat = obDone;
}
break;
- }else if( wctrlFlags & WHERE_DISTINCTBY ){
- pLoop->u.btree.nDistinctCol = 0;
}
iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;