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 1B66C6FC87; Fri, 1 Oct 2021 15:48:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1B66C6FC87 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633092512; bh=RqYNVqEgb1WrQm4fWZaxxHiuFYDvSeOoRxgUnBh3AYE=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Pusw6XBnwwZ/ZxJhOfRqDiXhBsT4ZvfjOUKHFs+8Dhn0uQ4UsY3bzMsBaqTWfi2FT ac6Z4HX6yRlqhhmyod9oA4dFsapiQeRM4O/c7kfJagjPKPhaAH64KglVvZkwiEP0LU an/Yx7d0Mfq9KLUKoBxoSK9cPTPih7slyycGCn9M= Received: from smtpng1.i.mail.ru (smtpng1.i.mail.ru [94.100.181.251]) (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 8B6B26FC87 for ; Fri, 1 Oct 2021 15:48:30 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 8B6B26FC87 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mWHxl-0003px-E4; Fri, 01 Oct 2021 15:48:30 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 1 Oct 2021 15:48:29 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD96A58C36AA2E99649C8C87BF8DECC9FC9CB42A33403F58D3C182A05F53808504059120A81C5F4CBEF08100952266123C4F03D8E5C668D6C365895D9B211DB9B17 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE749E89BD568380EECC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE735102D6D0BF494F7EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2BEA8D5452566517256CC9415A71D477DCC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735E4A630A5B664A4FFC4224003CC83647689D4C264860C145E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBBB17C150BCA6793B3DB10428CAD1E8F2B5B762CE851DF4B9C2B6934AE262D3EE7EAB7254005DCED1C8AEA1E975C27AC1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0395A35BF0C2A4EB88E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34B5900AD87B4159A475BA595A5607250A2D70C1D2EC01D20C575E444221B0C79289AFC01035B3E9C11D7E09C32AA3244C6C45FE941865C16BBF1911106758E54E7101BF96129E4011729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojJNmX3owDPmHIROplBpA2cA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D783670E40512FB91A2FB34DF9318FF9783D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v4 00/16] sql: refactor aggregate functions 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" This patch-set refactor the aggregate functions and does some refactoring of the SQL function infrastructure as a whole. https://github.com/tarantool/tarantool/issues/4145 https://github.com/tarantool/tarantool/tree/imeevma/gh-4145-aggregate-functions Changes in v2: - Added commit to remove possible UB in int-to-double implicit cast function. - Added commit to drop argv from struct sql_context. - Review fixes. Changes in v3: - All functional changes were carried over from this patch-set. All that's left is refactoring. Changes in v4: - Zeroblob optimization was removed, which allowed to simplify code and avoid some errors. Mergen Imeev (16): sql: remove MEM_Zero flag from struct MEM sql: fix possible undefined behavior during cast sql: use register P1 for number of arguments sql: remove AggStep0 and OP_BuiltinFunction0 sql: move collation to struct sql_context sql: introduce mem_append() sql: remove sql_vdbemem_finalize() sql: refactor SUM() function sql: refactor TOTAL() function sql: refactor AVG() function sql: refactor COUNT() function sql: refactor MIN() and MAX() functions sql: refactor GROUP_CONCAT() function sql: remove copying of result in finalizers sql: remove MEM_TYPE_AGG sql: remove field argv from struct sql_context src/box/sql/date.c | 43 --- src/box/sql/expr.c | 19 +- src/box/sql/func.c | 812 +++++++++++++++++++----------------------- src/box/sql/main.c | 5 +- src/box/sql/mem.c | 200 ++--------- src/box/sql/mem.h | 51 +-- src/box/sql/select.c | 35 +- src/box/sql/sqlInt.h | 40 +-- src/box/sql/vdbe.c | 202 ++--------- src/box/sql/vdbeInt.h | 7 +- src/box/sql/vdbeapi.c | 108 ------ src/box/sql/vdbeaux.c | 21 +- 12 files changed, 504 insertions(+), 1039 deletions(-) -- 2.25.1