1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

When a virtual table reports orderByConsumed, that tells us nothing about

whether or not the SQLITE_DISTINCTBY constraint is met.
Fix for ticket [7e59041f9c4e5102].
Test cases in TH3.

FossilOrigin-Name: b59f94e4da9b1653f2004b214407a50340dd476b27e6ec7e29e501a95db9c963
This commit is contained in:
drh
2019-11-08 20:13:44 +00:00
parent 1e7c00e695
commit ff1032e5c2
3 changed files with 10 additions and 8 deletions

View File

@@ -3696,7 +3696,9 @@ static i8 wherePathSatisfiesOrderBy(
pLoop = pLast;
}
if( pLoop->wsFlags & WHERE_VIRTUALTABLE ){
if( pLoop->u.vtab.isOrdered ) obSat = obDone;
if( pLoop->u.vtab.isOrdered && (wctrlFlags & WHERE_DISTINCTBY)==0 ){
obSat = obDone;
}
break;
}else if( wctrlFlags & WHERE_DISTINCTBY ){
pLoop->u.btree.nDistinctCol = 0;