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 C8E126EC40; Thu, 19 Aug 2021 15:02:56 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C8E126EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629374576; bh=VUEjp/TgW9CIKXJdC/bG0kXYmyLPzISs3V1dduV/uVI=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=t4Ydhc51AZdH1DinvQis5EE77c0onAqPrbV6mdBhZuKUYznKt0OhYJ5CjsN/q4Ira tDYRWGNovCaVQ4NwPpNMuohDDRfaJ09D5cWrP2QfOw76MV8ENOlj0eSHtKQqCn9imM ozYy3eNBLmi8MD+oDcRa3Ioqk88zMBVP6fUpHY0g= 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 D38666EC40 for ; Thu, 19 Aug 2021 15:02:55 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D38666EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mGgl4-0000vW-Pd; Thu, 19 Aug 2021 15:02:55 +0300 To: kyukhin@tarantool.org, v.ioffe@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Thu, 19 Aug 2021 15:02:54 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9ECFD080E047A606F6525B29142351271182A05F53808504052BCDC21E6741C10A261B80366D4EAF677F12C8BA7D1BB2E93558DD45C15BBB4 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE78981306C6E927004EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637E1D1CAB2F25BBDB78638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8C2D8CFBF4D37DA6EDC79BA04626FE3C2117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6300D3B61E77C8D3B089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CF160826E4E1956AEFA0D3617A049B9E475923CDB8F84F5DF9C2B6934AE262D3EE7EAB7254005DCED181F6AECF729D14E92E1F3B950BCE21616EB5DE968479BF5F7C8EA5FCD022BB8BDC6A1CF3F042BAD6DF99611D93F60EF4AAE2D1698E8717B699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346C409ABC5F9C579BE4738AD7EC7BC2071A85AC09EFFDB8BB41CAB808CE8483D096EB9BBED713A11E1D7E09C32AA3244C99C12EF4D0052C7A56A570E68D49BEC8D9ADFF0C0BDB8D1FFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBGgB73s28778w== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DB312F205E28E86A25A68F01C83D4676883D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 0/9] Check types of SQL built-in functions arguments 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 introduces static and dynamic type checks for SQL built-in functions. https://github.com/tarantool/tarantool/issues/6105 https://github.com/tarantool/tarantool/tree/imeevma/gh-6105-properly-check-funcs-args-types Mergen Imeev (9): sql: modify signature of TRIM() sql: rework SQL built-in functions hash table sql: check number of arguments during parsing sql: static type check for SQL built-in functions sql: runtime type check for SQL built-in functions sql: enable types checking for some functions sql: fix result type of min() and max() functions sql: check argument types of sum(), avg(), total() sql: arguments check for string value functions .../gh-6105-built-in-functions-args.md | 6 + src/box/sql/expr.c | 36 +- src/box/sql/func.c | 1339 +++++++---------- src/box/sql/mem.c | 2 +- src/box/sql/parse.y | 36 +- src/box/sql/prepare.c | 2 +- src/box/sql/resolve.c | 44 +- src/box/sql/select.c | 10 +- src/box/sql/sqlInt.h | 13 + test/sql-tap/aggnested.test.lua | 8 +- test/sql-tap/badutf1.test.lua | 34 +- test/sql-tap/built-in-functions.test.lua | 548 +++++++ test/sql-tap/coalesce.test.lua | 2 +- test/sql-tap/cse.test.lua | 8 +- test/sql-tap/distinctagg.test.lua | 3 +- test/sql-tap/e_select1.test.lua | 30 +- test/sql-tap/engine.cfg | 3 + test/sql-tap/func.test.lua | 213 +-- test/sql-tap/func2.test.lua | 18 +- test/sql-tap/func5.test.lua | 6 +- .../gh-6299-lost-collation-on-trim.test.lua | 47 + test/sql-tap/minmax2.test.lua | 5 +- test/sql-tap/minmax4.test.lua | 2 +- test/sql-tap/null.test.lua | 2 +- test/sql-tap/orderby1.test.lua | 2 +- test/sql-tap/position.test.lua | 84 +- test/sql-tap/select1.test.lua | 4 +- test/sql-tap/select3.test.lua | 16 +- test/sql-tap/select5.test.lua | 2 +- test/sql-tap/select6.test.lua | 21 +- test/sql-tap/selectG.test.lua | 2 +- test/sql-tap/sql-errors.test.lua | 2 +- test/sql-tap/subquery.test.lua | 8 +- test/sql-tap/substr.test.lua | 6 +- test/sql-tap/tkt2942.test.lua | 10 +- test/sql-tap/uuid.test.lua | 86 +- test/sql-tap/view.test.lua | 2 +- test/sql-tap/where3.test.lua | 6 +- test/sql-tap/with1.test.lua | 2 +- test/sql/boolean.result | 45 +- test/sql/collation.result | 2 +- test/sql/iproto.result | 4 +- test/sql/max-on-index.result | 6 +- test/sql/prepared.result | 12 +- test/sql/prepared.test.lua | 2 +- test/sql/types.result | 122 +- 46 files changed, 1498 insertions(+), 1365 deletions(-) create mode 100644 changelogs/unreleased/gh-6105-built-in-functions-args.md create mode 100755 test/sql-tap/built-in-functions.test.lua create mode 100755 test/sql-tap/gh-6299-lost-collation-on-trim.test.lua -- 2.25.1