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 3A9F76F867; Tue, 1 Feb 2022 16:38:23 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3A9F76F867 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1643722703; 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=WHX7veiviLGUbyH0yPkX/EMo9quiGeMlcFPPt+wzuhnhqS4LNcSri+GU12pcAAZ7T 3/dWbVFKvKugc/3Z9YO0a5U+UAQIIDTozdS1KTPAQs/QCcVgtgQEmUwa0sGAYuntj+ cMGZBAT/j9YZGymUZkZJNL/mrEP6jHKl/AyIS0FM= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 B01736F868 for ; Tue, 1 Feb 2022 16:37:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B01736F868 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1nEtLY-0007k1-4Y; Tue, 01 Feb 2022 16:37:24 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 1 Feb 2022 16:37:23 +0300 Message-Id: <8607c2a2bc69b1648d78351d9b7afb90ee7ce9c0.1643722506.git.imeevma@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD99F281FB7F96F126D7C01DDBDD3B148B19E689FD613B2B09700894C459B0CD1B9BC8A9E640DC36C57071F5A73BD465329AA45120333E8030E4044E5D25B716309 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE74AA616721CED6291EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637670E1B164B70895C8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84860FDB0C01F89AD2A4D9E42A19A9720117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC3A703B70628EAD7BA471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10F6FD1C55BDD38FC3FD2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6D635BA3ABDB36C18089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-8FC586DF: 6EFBBC1D9D64D975 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CCED4562AEA10A75F4CA3F0A74B718358F219F0DEEAA68C679C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFE323A604FE95ED09DC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34FACF503ACC83041B299E08B44597BD4EA0524443A38EC48AA5F01F55A82858454D1DE8714135F5071D7E09C32AA3244CF74F9BE4BE55FBA5DDB9E990A953A44B9CA7333006C390A0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioje/Fy4v4Lxypgjx+ok/Q8tw== X-Mailru-Sender: 689FA8AB762F739339CABD9B3CA9A7D6924D326B777E0A64E0CE4BEEEE37E86A83D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E3365FEEDEB644C299C0ED14614B50AE0675 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