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 7B7406EC40; Tue, 21 Sep 2021 13:59:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 7B7406EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1632221940; bh=o2C+rzAOhOjmLCdnTv5GI5Gg3SKeh1K5NhT0TdlnYHU=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=vsdOVBMywFO7tk8SzaNbTfAhULuTlANSqVXXl6n3zBz6IUzzgHSrACX2ZyXyR8wCz 4iQVlHpygnYz2JzP93GzguA9hlfu+NJ2Y6o4hdDkU1sUlTN5e4Yym+AV5n0gBS/TPP ndc9W1zD1OKqKi/f7JhsJGpkc5585dUR3RLUt+98= Received: from smtpng2.i.mail.ru (smtpng2.i.mail.ru [94.100.179.3]) (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 737A76EC40 for ; Tue, 21 Sep 2021 13:58:59 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 737A76EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mSdUI-0002M9-Oe; Tue, 21 Sep 2021 13:58:59 +0300 To: v.shpilevoy@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 21 Sep 2021 13:58:58 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD91AE02D33A9C88A2F7631404A3C5D35349DE4D58F47F062C400894C459B0CD1B977FE0824A4996A2E7C8B054A55B0D2A2994D8960CDEEF0A82059E94B53F79380 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7B264C8851FD8E810EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C5BAFDCCAC60DA968638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D88AA1A89EE70A0289872CE05672A94319117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B62CFFCC7B69C47339089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CB382FA991BF7A44C27C527A72E78B61208487B2EDE5CBEA59C2B6934AE262D3EE7EAB7254005DCEDF1D44946AC0875EC1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B0B354FDD77FA17EA25A4FF58CDAEABE2AA132EA92956906CB2F2B26349833648869F8FEF10F1C2C2993EDB24507CE13387DFF0A840B692CF8 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C1D376EF32BB0896BA040479CC41A4581A64DE72AD41BDC6DDA2EFDD71B20D0F3CE8FFC390D5E7431D7E09C32AA3244CDB8E7781AF1C987FA9707011B496F7F2A995755A1445935E729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnvI84oHUDXActSWaiSNwog== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D178D37768575DBEA1770AB033C7FFCD983D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v2 00/15] sql: reworks 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 reworks aggregate functions. After this patch-set they should work according to new rules. Non-aggregate SQL built-in functions will be reworked in another patch-set. Also, this patch makes some refactoring of struct sql_context. 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. 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: rework SUM() sql: rework TOTAL() sql: rework AVG() sql: rework COUNT() sql: rework MIN() and MAX() sql: rework GROUP_CONCAT() 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 | 806 ++++++++++------------- src/box/sql/main.c | 5 +- src/box/sql/mem.c | 77 +-- src/box/sql/mem.h | 29 +- src/box/sql/select.c | 29 +- src/box/sql/sqlInt.h | 23 +- src/box/sql/vdbe.c | 196 ++---- src/box/sql/vdbeInt.h | 7 +- src/box/sql/vdbeapi.c | 66 -- src/box/sql/vdbeaux.c | 13 +- test/sql-tap/built-in-functions.test.lua | 97 ++- 13 files changed, 571 insertions(+), 839 deletions(-) -- 2.25.1