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 56959711AC; Tue, 26 Oct 2021 13:34:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 56959711AC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1635244446; bh=GIBuPi5XIl45IWXOs1cb3EFOgdoT+l5l9/vOQSXYfiU=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=N67Eo6ZBW+GXQpp5aB0ctV6Zf2cK9FR8tuV3ZIcAJJNRLkkWPWDFmS3O/sTy/0ZHs nfxmbBcjtQPFv0iZtiBwVyOlR0M8gTxabk86UhzI6lJ7D9BqseLP9C7JvuCRxXqWHC s+/uMTRplaKhaKwa3exV8rXuK6PK0NtuSzJ9+Hxc= 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 E0DB77034A for ; Tue, 26 Oct 2021 13:34:03 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E0DB77034A Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mfJmM-0000XK-QQ; Tue, 26 Oct 2021 13:34:03 +0300 To: kyukhin@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Tue, 26 Oct 2021 13:34:02 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D1D35DBD2D15487E4274513AD34F4DF9AF58D12A9008B398182A05F53808504032964D6DAAECDFCD20F9E15FF596EF471CF2E3789ACC50A2D686E0DFDE597CC8 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76042E2DB3E33BF2BEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006375104F503C4FA42DF8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8EB291B5E69336E95102691451E019242117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F44604297287769387670735209ECD01F8117BC8BEA471835C12D1D977C4224003CC8364762BB6847A3DEAEFB0F43C7A68FF6260569E8FC8737B5C2249EC8D19AE6D49635B68655334FD4449CB9ECD01F8117BC8BEAAAE862A0553A39223F8577A6DFFEA7CD1D040B6C1ECEA3F43847C11F186F3C59DAA53EE0834AAEE X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C2749EEF4D85F8CCA1C211D389D39C9DA186FC7DDB9A33AB09C2B6934AE262D3EE7EAB7254005DCED1C8AEA1E975C27AC1E0A4E2319210D9B64D260DF9561598F01A9E91200F654B065920EE9444264EA8E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34738A88CA0C70A55837BA02E6EC9DA3133720634C831D14BBD19C39A4B160A7CE8EF4556C6261B29F1D7E09C32AA3244C0C878795C1424205263745D0130908803FD9C8CA1B0515E0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojNvH0qP3qm72i9AgKI9SzvA== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D122F710104DE0EA0C111506A7A9EE2D283D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B 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 .../gh-6113-fix-segfault-in-hex-func.md | 4 + 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 | 200 +---- src/box/sql/mem.h | 57 +- 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 +- test/sql-tap/engine.cfg | 1 + ...gh-6113-assert-in-hex-on-zeroblob.test.lua | 13 + 15 files changed, 524 insertions(+), 1037 deletions(-) create mode 100644 changelogs/unreleased/gh-6113-fix-segfault-in-hex-func.md create mode 100755 test/sql-tap/gh-6113-assert-in-hex-on-zeroblob.test.lua -- 2.25.1