Lines Matching refs:pSort
109151 SortCtx *pSort, /* Information about the ORDER BY clause */
109159 int bSeq = ((pSort->sortFlags & SORTFLAG_UseSorter)==0);
109160 int nExpr = pSort->pOrderBy->nExpr; /* No. of ORDER BY terms */
109164 int nOBSat = pSort->nOBSat; /* ORDER BY terms to skip */
109176 sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData,
109179 sqlite3VdbeAddOp2(v, OP_Sequence, pSort->iECursor, regBase+nExpr);
109195 pParse->nMem += pSort->nOBSat;
109196 nKey = nExpr - pSort->nOBSat + bSeq;
109200 addrFirst = sqlite3VdbeAddOp1(v, OP_SequenceTest, pSort->iECursor);
109203 sqlite3VdbeAddOp3(v, OP_Compare, regPrevKey, regBase, pSort->nOBSat);
109204 pOp = sqlite3VdbeGetOp(v, pSort->addrSortIndex);
109211 pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat,
109215 pSort->labelBkOut = sqlite3VdbeMakeLabel(v);
109216 pSort->regReturn = ++pParse->nMem;
109217 sqlite3VdbeAddOp2(v, OP_Gosub, pSort->regReturn, pSort->labelBkOut);
109218 sqlite3VdbeAddOp1(v, OP_ResetSorter, pSort->iECursor);
109220 sqlite3ExprCodeMove(pParse, regBase, regPrevKey, pSort->nOBSat);
109223 if( pSort->sortFlags & SORTFLAG_UseSorter ){
109228 sqlite3VdbeAddOp2(v, op, pSort->iECursor, regRecord);
109238 sqlite3VdbeAddOp1(v, OP_Last, pSort->iECursor);
109239 sqlite3VdbeAddOp1(v, OP_Delete, pSort->iECursor);
109323 SortCtx *pSort, /* If not NULL, info on how to process ORDER BY */
109341 if( pSort && pSort->pOrderBy==0 ) pSort = 0;
109342 if( pSort==0 && !hasDistinct ){
109352 if( pSort ){
109353 nPrefixReg = pSort->pOrderBy->nExpr;
109354 if( !(pSort->sortFlags & SORTFLAG_UseSorter) ) nPrefixReg++;
109444 if( pSort==0 ){
109496 assert( pSort==0 );
109499 if( pSort ){
109500 pushOntoSorter(pParse, pSort, p, r1+nPrefixReg,regResult,1,nPrefixReg);
109521 if( pSort ){
109526 pushOntoSorter(pParse, pSort, p, regResult, regResult, 1, nPrefixReg);
109551 if( pSort ){
109552 pushOntoSorter(pParse, pSort, p, regResult, regResult, 1, nPrefixReg);
109565 if( pSort ){
109566 pushOntoSorter(pParse, pSort, p, regResult, regResult, nResultCol,
109643 if( pSort==0 && p->iLimit ){
109835 SortCtx *pSort, /* Information on the ORDER BY clause */
109845 ExprList *pOrderBy = pSort->pOrderBy;
109859 if( pSort->labelBkOut ){
109860 sqlite3VdbeAddOp2(v, OP_Gosub, pSort->regReturn, pSort->labelBkOut);
109862 sqlite3VdbeResolveLabel(v, pSort->labelBkOut);
109864 iTab = pSort->iECursor;
109874 nKey = pOrderBy->nExpr - pSort->nOBSat;
109875 if( pSort->sortFlags & SORTFLAG_UseSorter ){
109878 if( pSort->labelBkOut ){
109941 if( pSort->sortFlags & SORTFLAG_UseSorter ){
109946 if( pSort->regReturn ) sqlite3VdbeAddOp1(v, OP_Return, pSort->regReturn);