diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 5 | ||||
-rw-r--r-- | src/vdbe.c | 18 | ||||
-rw-r--r-- | src/vdbeInt.h | 1 |
3 files changed, 6 insertions, 18 deletions
diff --git a/src/func.c b/src/func.c index 5b7056b40..cf556e243 100644 --- a/src/func.c +++ b/src/func.c @@ -22,7 +22,10 @@ ** Return the collating function associated with a function. */ static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){ - return context->pColl; + VdbeOp *pOp = &context->pVdbe->aOp[context->iOp-1]; + assert( pOp->opcode==OP_CollSeq ); + assert( pOp->p4type==P4_COLLSEQ ); + return pOp->p4.pColl; } /* diff --git a/src/vdbe.c b/src/vdbe.c index 27d7e7490..8ae56416f 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -1557,17 +1557,8 @@ case OP_Function: { ctx.iOp = pc; ctx.pVdbe = p; MemSetTypeFlag(ctx.pOut, MEM_Null); - ctx.fErrorOrAux = 0; - if( ctx.pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){ - assert( pOp>aOp ); - assert( pOp[-1].p4type==P4_COLLSEQ ); - assert( pOp[-1].opcode==OP_CollSeq ); - ctx.pColl = pOp[-1].p4.pColl; - } - db->lastRowid = lastRowid; (*ctx.pFunc->xFunc)(&ctx, n, apVal); /* IMP: R-24505-23230 */ - lastRowid = db->lastRowid; /* If the function returned an error, throw an exception */ if( ctx.fErrorOrAux ){ @@ -5624,14 +5615,9 @@ case OP_AggStep: { sqlite3VdbeMemInit(&t, db, MEM_Null); ctx.pOut = &t; ctx.isError = 0; - ctx.pColl = 0; + ctx.pVdbe = p; + ctx.iOp = pc; ctx.skipFlag = 0; - if( ctx.pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){ - assert( pOp>p->aOp ); - assert( pOp[-1].p4type==P4_COLLSEQ ); - assert( pOp[-1].opcode==OP_CollSeq ); - ctx.pColl = pOp[-1].p4.pColl; - } (ctx.pFunc->xStep)(&ctx, n, apVal); /* IMP: R-24505-23230 */ if( ctx.isError ){ sqlite3SetString(&p->zErrMsg, db, "%s", sqlite3_value_text(&t)); diff --git a/src/vdbeInt.h b/src/vdbeInt.h index 56b5db7d1..f54c9c6d3 100644 --- a/src/vdbeInt.h +++ b/src/vdbeInt.h @@ -272,7 +272,6 @@ struct sqlite3_context { Mem *pOut; /* The return value is stored here */ FuncDef *pFunc; /* Pointer to function information */ Mem *pMem; /* Memory cell used to store aggregate context */ - CollSeq *pColl; /* Collating sequence */ Vdbe *pVdbe; /* The VM that owns this context */ int iOp; /* Instruction number of OP_Function */ int isError; /* Error code returned by the function. */ |