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

Update virtual tables json_each and json_tree so that adding "ORDER BY rowid" to a query does not require an external sort.

FossilOrigin-Name: ce18f0ed684824e67ed6c09acab8e735fef2c52b2ed32270dee1a2a67802c59b
This commit is contained in:
dan
2023-01-17 15:46:27 +00:00
parent c37af308fa
commit 19ab86f3ff
5 changed files with 102 additions and 11 deletions

View File

@@ -2473,6 +2473,13 @@ static int jsonEachBestIndex(
idxMask |= iMask;
}
}
if( pIdxInfo->nOrderBy>0
&& pIdxInfo->aOrderBy[0].iColumn<0
&& pIdxInfo->aOrderBy[0].desc==0
){
pIdxInfo->orderByConsumed = 1;
}
if( (unusableMask & ~idxMask)!=0 ){
/* If there are any unusable constraints on JSON or ROOT, then reject
** this entire plan */