aboutsummaryrefslogtreecommitdiff
path: root/src/vdbemem.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2018-05-16 20:58:07 +0000
committerdan <dan@noemail.net>2018-05-16 20:58:07 +0000
commit86fb6e173885b9ac170b14ce9a9d0ccf7cd34e50 (patch)
treeca728c5c40cf8c1487880b4446d95d75f3cdbe6e /src/vdbemem.c
parentf80bba9d8d6a1bff6728db40d8d65af06d0723f9 (diff)
downloadsqlite-86fb6e173885b9ac170b14ce9a9d0ccf7cd34e50.tar.gz
sqlite-86fb6e173885b9ac170b14ce9a9d0ccf7cd34e50.zip
Start of experimental implementation of SQL window functions. Does not yet
work. FossilOrigin-Name: 3781e520854808fe02ad3fe77dd11fc917448c58ff1fd79123289dd91937decd
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