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 AA26C6EC60; Fri, 13 Aug 2021 06:17:06 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AA26C6EC60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1628824626; bh=M4mlodL+LGrsaLOx3UA19imy64JHessXNIgsTsZvZIM=; h=To:Cc:Date:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=UsRiKDP2fvSZy6fn9tvvIvhTgcBa07DEtzvQeM5zz68Tsh9pt4X+GIuzY6EgWm1Um Ef+FKW0lxptYjCTYzPl0DkiVQTpLuoTx13xm8iEC0w/jkCiELNWNpozeKVgEJPsxm5 6f3T7KAUQbrud5mpMY2YJsKCNvfYOe35voHVAYvM= 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 812846EC60 for ; Fri, 13 Aug 2021 06:17:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 812846EC60 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mENgt-0002Ga-MQ; Fri, 13 Aug 2021 06:17:04 +0300 To: vdavydov@tarantool.org Cc: tarantool-patches@dev.tarantool.org Date: Fri, 13 Aug 2021 06:17:03 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD906AB4890CDABF0C5CB76CEE71D3E4007182A05F538085040E56E7B9465574867A90BB5113571C3883495AC21687DF0D890C5E0B2C27E0614 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71EAE3A63419E5AEDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006374E296C64F8F911C48638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8A1ABDB55ECD54DA493AA5E5C25C35AD4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCAA867293B0326636D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAA867293B0326636D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B66F6A3E018CF4DC80089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B5059A91936EF7B6732DCA1B6536DF145B2E X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C69415AB31670C86CE508812D7280863B3794807DABF2C1139C2B6934AE262D3EE7EAB7254005DCED0E6F8C16B49E17FC92E1F3B950BCE21616EB5DE968479BF5F7C8EA5FCD022BB8BDC6A1CF3F042BAD6DF99611D93F60EFAE6B62100CB10EE2699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34C786159FDC4342B00F618EC836574773202D9538EA0650E8BE7949856166BC3D5D7449E52770319C1D7E09C32AA3244CD6290C87B8C94FAF87868F3FF4D957C23FD9C8CA1B0515E0729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0dLV0c3jbkxLK+gRZf5eJg== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DF86AA8527E6653966817F1AFFC1AEA3283D72C36FC87018B9F80AB2734326CD2FB559BB5D741EB96352A0ABBE4FDA4210A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v1 00/10] 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 (10): 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: fix quote() function sql: arguments check for string value functions src/box/sql/expr.c | 36 +- src/box/sql/func.c | 1357 +++++++---------- 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 | 593 +++++++ 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/trigger5.test.lua | 3 +- 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 | 136 +- 46 files changed, 1550 insertions(+), 1387 deletions(-) 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