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 1A9B66FC8B; Fri, 1 Oct 2021 10:42:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1A9B66FC8B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1633074167; bh=XOOb0eRsW4fMQOUE4r37n59JKPWsImKZVmh+hovPFU0=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=oNsREHsUeeH6EOtSZ/2bOG/WotEz83jLz17RyPoG291KamV73B+YTnR0tEl0S2cbF FvdTVALK5X5i9MhYtSS48XzI7CIELLP/5lbW+flBOPleEb5nKGJd6ulhpSAjwpyOVX SiDBHT6Mxu2sW0fZndWNh32xIfhm48KeDRTiZOAU= 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 30C266FC87 for ; Fri, 1 Oct 2021 10:42:45 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 30C266FC87 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mWDBs-0004Rx-Al; Fri, 01 Oct 2021 10:42:44 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 1 Oct 2021 10:42:43 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD96A58C36AA2E996499DED20B83AFF2DE90C450EFC080BE8B7182A05F538085040529D9624E374B2F3D9E8F4DC6850F40F2F7730D91358703F2C1EE08D1C1B3050 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AED985C8E545F588EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006373DBA3D7E24987517EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2B69E7BF9294583036FACC744168B4963CC7F00164DA146DAFE8445B8C89999728AA50765F790063783E00425F71A4181389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8EDCF5861DED71B2F389733CBF5DBD5E9B5C8C57E37DE458B9E9CE733340B9D5F3BBE47FD9DD3FB595F5C1EE8F4F765FC72CEEB2601E22B093A03B725D353964B0B7D0EA88DDEDAC722CA9DD8327EE4930A3850AC1BE2E735444A83B712AC0148C4224003CC83647689D4C264860C145E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CBBB17C150BCA6793E1A15EBC3DB915AB23B26C8C960E04869C2B6934AE262D3EE7EAB7254005DCED1C8AEA1E975C27AC1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B02272C4C079A4C8AD93EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D349EC559D073CA5B68714AA818DC477906A371038FE331D275AAFA6B2D78B8507EA232870CBE92D18A1D7E09C32AA3244C010DD6CB25D2D8C425F5DB2C2B15F3C8250262A5EE9971B0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojbL9S8ysBdXj27MsRdIC3n2E7GGnzi8kD X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DBEE04197F04A69A63A51AB007557827083D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v3 00/15] 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. Mergen Imeev (15): 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 | 815 +++++++++++++++++-------------------- src/box/sql/main.c | 5 +- src/box/sql/mem.c | 81 ++-- src/box/sql/mem.h | 29 +- src/box/sql/select.c | 35 +- src/box/sql/sqlInt.h | 26 +- src/box/sql/vdbe.c | 192 ++------- src/box/sql/vdbeInt.h | 7 +- src/box/sql/vdbeapi.c | 66 --- src/box/sql/vdbeaux.c | 21 +- test/sql-tap/func.test.lua | 15 +- 13 files changed, 506 insertions(+), 848 deletions(-) -- 2.25.1