aboutsummaryrefslogtreecommitdiff
path: root/src/vdbemem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vdbemem.c')
-rw-r--r--src/vdbemem.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vdbemem.c b/src/vdbemem.c
index d118d2bb9..a64ed0963 100644
--- a/src/vdbemem.c
+++ b/src/vdbemem.c
@@ -415,6 +415,23 @@ int sqlite3VdbeMemFinalize(Mem *pMem, FuncDef *pFunc){
return ctx.isError;
}
+int sqlite3VdbeMemAggValue(Mem *pAccum, Mem *pOut, FuncDef *pFunc){
+ sqlite3_context ctx;
+ Mem t;
+ assert( pFunc!=0 );
+ assert( pFunc->xValue!=0 );
+ assert( (pAccum->flags & MEM_Null)!=0 || pFunc==pAccum->u.pDef );
+ assert( pAccum->db==0 || sqlite3_mutex_held(pAccum->db->mutex) );
+ memset(&ctx, 0, sizeof(ctx));
+ memset(&t, 0, sizeof(t));
+ t.flags = MEM_Null;
+ t.db = pAccum->db;
+ ctx.pOut = pOut;
+ ctx.pMem = pAccum;
+ ctx.pFunc = pFunc;
+ pFunc->xValue(&ctx);
+ return ctx.isError;
+}
/*
** If the memory cell contains a value that must be freed by
** invoking the external callback in Mem.xDel, then this routine