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

Remove the sequence values from sorter records used by ORDER BY as well.

FossilOrigin-Name: c3ae3697832a00d4d5758988a8766bdbb691e6b8
This commit is contained in:
dan
2014-03-25 15:04:07 +00:00
parent dd23c6bfb4
commit 78d5843245
4 changed files with 53 additions and 21 deletions

View File

@@ -3385,6 +3385,24 @@ case OP_SorterOpen: {
break;
}
/* Opcode: SequenceTest P1 P2 * * *
** Synopsis: if( cursor[P1].ctr++ ) pc = P2
**
** P1 is a sorter cursor. If the sequence counter is currently zero, jump
** to P2. Regardless of whether or not the jump is taken, increment the
** the sequence value.
*/
case OP_SequenceTest: {
VdbeCursor *pC;
assert( pOp->p1>=0 && pOp->p1<p->nCursor );
pC = p->apCsr[pOp->p1];
assert( pC->pSorter );
if( (pC->seqCount++)==0 ){
pc = pOp->p2 - 1;
}
break;
}
/* Opcode: OpenPseudo P1 P2 P3 * *
** Synopsis: P3 columns in r[P2]
**