mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Fix the ORDER BY optimization logic so that it will do a block-sort on
a partial DESC ORDER BY. This enhancement uncovered a memory leak in pushUntoSorter() which is also fixed. FossilOrigin-Name: c36f74611cf17ad2ff198a2ac2054d7ab451a72c
This commit is contained in:
@@ -488,6 +488,7 @@ static void pushOntoSorter(
|
||||
addrFirst = sqlite3VdbeAddOp1(v, OP_IfNot, regBase+nExpr); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp3(v, OP_Compare, regPrevKey, regBase, pSort->nOBSat);
|
||||
pOp = sqlite3VdbeGetOp(v, pSort->addrSortIndex);
|
||||
if( pParse->db->mallocFailed ) return;
|
||||
pOp->p2 = nKey + 1;
|
||||
sqlite3VdbeChangeP4(v, -1, (char*)pOp->p4.pKeyInfo, P4_KEYINFO);
|
||||
pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, 1);
|
||||
|
||||
Reference in New Issue
Block a user