1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Make it possible for block-sort to use the OP_SorterOpen sorter in addition

to a generic OP_OpenEphemeral.

FossilOrigin-Name: 7ce2daafd39a117041bfdd0a7132e2764fe7a74b
This commit is contained in:
drh
2014-03-19 17:41:36 +00:00
parent 26d7e7c6b7
commit 65ea12cb4a
6 changed files with 52 additions and 30 deletions

View File

@@ -4872,20 +4872,26 @@ case OP_Clear: {
break;
}
/* Opcode: ClearEphem P1 * * * *
/* Opcode: ResetSorter P1 * * * *
**
** Delete all contents from the ephemeral table that is open on cursor P1.
** Delete all contents from the ephemeral table or sorter
** that is open on cursor P1.
**
** See also: Clear, Destroy
** This opcode only works for cursors used for sorting and
** opened with OP_OpenEphemeral or OP_SorterOpen.
*/
case OP_ClearEphem: {
case OP_ResetSorter: {
VdbeCursor *pC;
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
pC = p->apCsr[pOp->p1];
assert( pC!=0 );
assert( pC->isEphemeral );
rc = sqlite3BtreeClearTableOfCursor(pC->pCursor);
if( pC->pSorter ){
sqlite3VdbeSorterReset(db, pC->pSorter);
}else{
assert( pC->isEphemeral );
rc = sqlite3BtreeClearTableOfCursor(pC->pCursor);
}
break;
}