Tarantool development patches archive
 help / color / mirror / Atom feed
From: Mergen Imeev via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: v.shpilevoy@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2 2/4] sql: drop unnecessary P2 register for OP_AggFinal
Date: Tue,  1 Feb 2022 16:37:23 +0300	[thread overview]
Message-ID: <8607c2a2bc69b1648d78351d9b7afb90ee7ce9c0.1643722506.git.imeevma@gmail.com> (raw)
In-Reply-To: <cover.1643722506.git.imeevma@gmail.com>

---
 src/box/sql/select.c |  4 +---
 src/box/sql/vdbe.c   | 17 +++++------------
 2 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/box/sql/select.c b/src/box/sql/select.c
index b532cac4e..6159a9670 100644
--- a/src/box/sql/select.c
+++ b/src/box/sql/select.c
@@ -5573,10 +5573,8 @@ finalizeAggFunctions(Parse * pParse, AggInfo * pAggInfo)
 	int i;
 	struct AggInfo_func *pF;
 	for (i = 0, pF = pAggInfo->aFunc; i < pAggInfo->nFunc; i++, pF++) {
-		ExprList *pList = pF->pExpr->x.pList;
 		assert(!ExprHasProperty(pF->pExpr, EP_xIsSelect));
-		sqlVdbeAddOp2(v, OP_AggFinal, pF->iMem,
-				  pList ? pList->nExpr : 0);
+		sqlVdbeAddOp1(v, OP_AggFinal, pF->iMem);
 		sqlVdbeAppendP4(v, pF->func, P4_FUNC);
 	}
 }
diff --git a/src/box/sql/vdbe.c b/src/box/sql/vdbe.c
index 24cb28260..c095bb833 100644
--- a/src/box/sql/vdbe.c
+++ b/src/box/sql/vdbe.c
@@ -4190,18 +4190,11 @@ case OP_AggStep: {
 	break;
 }
 
-/* Opcode: AggFinal P1 P2 * P4 *
- * Synopsis: accum=r[P1] N=P2
- *
- * Execute the finalizer function for an aggregate.  P1 is
- * the memory location that is the accumulator for the aggregate.
- *
- * P2 is the number of arguments that the step function takes and
- * P4 is a pointer to the FuncDef for this function.  The P2
- * argument is not used by this opcode.  It is only there to disambiguate
- * functions that can take varying numbers of arguments.  The
- * P4 argument is only needed for the degenerate case where
- * the step function was not previously called.
+/* Opcode: AggFinal P1 * * P4 *
+ * Synopsis: accum=r[P1]
+ *
+ * Execute the finalizer function for an aggregate. P1 is the memory location
+ * that is the accumulator for the aggregate. P4 is a pointer to the function.
  */
 case OP_AggFinal: {
 	assert(pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor));
-- 
2.25.1


  parent reply	other threads:[~2022-02-01 13:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-01 13:37 [Tarantool-patches] [PATCH v2 0/4] Introduce custom aggregate function Mergen Imeev via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 1/4] sql: fix COUNT() optimization conditions Mergen Imeev via Tarantool-patches
2022-02-01 13:37 ` Mergen Imeev via Tarantool-patches [this message]
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 3/4] sql: introduce custom aggregate functions Mergen Imeev via Tarantool-patches
2022-02-03 23:29   ` Vladislav Shpilevoy via Tarantool-patches
2022-02-01 13:37 ` [Tarantool-patches] [PATCH v2 4/4] sql: introduce FINALIZE for custom aggregate Mergen Imeev via Tarantool-patches
2022-02-03 23:30   ` Vladislav Shpilevoy via Tarantool-patches
2022-02-10  9:21     ` Mergen Imeev via Tarantool-patches
2022-02-10  9:14 [Tarantool-patches] [PATCH v2 0/4] Introduce custom aggregate functions Mergen Imeev via Tarantool-patches
2022-02-10  9:14 ` [Tarantool-patches] [PATCH v2 2/4] sql: drop unnecessary P2 register for OP_AggFinal Mergen Imeev via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8607c2a2bc69b1648d78351d9b7afb90ee7ce9c0.1643722506.git.imeevma@gmail.com \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=imeevma@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/4] sql: drop unnecessary P2 register for OP_AggFinal' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox