From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 8711A6E454; Thu, 10 Feb 2022 12:15:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8711A6E454 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1644484512; bh=MJMeUKNxW2J1BhNxZj2NgoVU0Q1qIPsdHuf28mQSkx4=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=xuQxP6p40a4bPls3TXMcX0GpuRUrNGAgKACMP2LeCl8gCWnNK4LU3CacMqikrnuzU tGnYMsYsnxNzBuhObRCFfWFRmWpERTUN+Q35fIvTOhXPW+fp8h2mQRNP/a14/r1RWW vz5zOBMu/Hs1KWoUxCsbg+KjUwQb6YhIKuxKqENM= Received: from smtp33.i.mail.ru (smtp33.i.mail.ru [94.100.177.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id CB29F6E229 for ; Thu, 10 Feb 2022 12:14:14 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org CB29F6E229 Received: by smtp33.i.mail.ru with esmtpa (envelope-from ) id 1nI5Wo-0004AU-0M; Thu, 10 Feb 2022 12:14:14 +0300 To: kyukhin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Thu, 10 Feb 2022 12:14:13 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9B74B50284A7C1A0B97F9FEC8801B7CF8F01E66BE5396193D182A05F5380850408CB0D004E3C1391236C9E572795A98E0E1BC829786F847ABE18AA4EEC930F6D4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74AA616721CED6291EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637670E1B164B70895C8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8ACCF9DDEE92A7B9F693E1184788DB91F117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE599709FD55CB46A6D94E105876FE7799D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE364E7220B7C5505926E0066C2D8992A16C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637AD0424077D726551EFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C05348A8C7D563C42462D0F301589924EEEE425DE6B366C559C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF4A2C4B6BA9DFC510699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FACF503ACC83041B299E08B44597BD4EA0524443A38EC48AA5F01F55A82858454D1DE8714135F5071D7E09C32AA3244C4CA32A8D98A766F3C46F4A5396864B90853296C06374E602729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojptAT+HCMDqPEs2QgA3bARA== X-Mailru-Sender: 5C3750E245F362008BC1685FEC6306ED5ED0F9320FE2819636C9E572795A98E0009DB4CE3002C7DB5105BD0848736F9966FEC6BF5C9C28D97E07721503EA2E00ED97202A5A4E92BF72D6B4FCE48DF648AE208404248635DF X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 2/4] sql: drop unnecessary P2 register for OP_AggFinal X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Mergen Imeev via Tarantool-patches Reply-To: imeevma@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" --- 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