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 3483F6EC55; Mon, 26 Jul 2021 23:13:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3483F6EC55 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1627330380; bh=uknzpfRGUrY3F5EfZ77jME12gAjPckT5/gYWh58iYbo=; h=To:Cc:References:Date:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=sFG3n78Y0+t0mBlRdCahA/H+dBrtLt1DfkXSrGOtuGXoKYVd9zYJ/KIpXRfVGTIUK RAt5kqB6WkbAR+CcCL+IaRaArmFhpnSicK/di46x4R9zkwmEqOloRd9xrYW+ARnjnG GvyAgyM+d8a9BIW+IaFu6OvMDVImX1vVTXzO0/UA= Received: from smtpng3.i.mail.ru (smtpng3.i.mail.ru [94.100.177.149]) (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 B6E126EC55 for ; Mon, 26 Jul 2021 23:12:57 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org B6E126EC55 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1m86y9-0006WK-1a; Mon, 26 Jul 2021 23:12:57 +0300 To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org References: Message-ID: <01e68660-cc8e-158b-dd9d-36643ece89db@tarantool.org> Date: Mon, 26 Jul 2021 22:12:56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD941C43E597735A9C366EE405EC28A2001F8302D8429E0DE58182A05F53808504039BB07B097524CD024AF2F6C9BA8F70E3B4C2A90B646F698AF00ADB0B6117AE7 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76C0A440987CA342DC2099A533E45F2D0395957E7521B51C2CFCAF695D4D8E9FCEA1F7E6F0F101C6778DA827A17800CE71EEA4C46C73542F4EA1F7E6F0F101C6723150C8DA25C47586E58E00D9D99D84E1BDDB23E98D2D38BBCA57AF85F7723F2A5DF0AA42FB5C0BCD41FCC1C049CC97CCC7F00164DA146DAFE8445B8C89999728AA50765F790063793270F7220657A0A389733CBF5DBD5E9C8A9BA7A39EFB766F5D81C698A659EA7CC7F00164DA146DA9985D098DBDEAEC8D2DCF9CF1F528DBCF6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8BDCE939D40DBB93CA75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458834459D11680B505BAD4EC533271CB92EEA800E6673CE261 X-C1DE0DAB: 0D63561A33F958A589595DCAC91457D8255B7FA6D9EA4874226129FAF65D80E5D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7517A45118377F5F9E8E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A1AF43396E40A36F5EDEEC17FF2ECFCC23747E0058D0F10B4F0594676801E3F589D44ED68C49C9E91D7E09C32AA3244C3228D55DD649B167D1C28C3E75543536E3D93501275E802F729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojMEANdStWW58J7g/i08vZ1Q== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D4E38C5C23A8A379C80B5C3700BBE3C723841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 2/2] sql: disallow explicit cast of VARBINARY to number 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Thanks for the patch! See 3 comments below. On 21.07.2021 17:10, Mergen Imeev via Tarantool-patches wrote: > This patch removes explicit cast of VARBINARY values to numeric types. > > Part of #4470 > Closes #4772 > Closes #5852 1. You might need to add a changelog file. > diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua > index 3dc49c38e..379fbf09e 100755 > --- a/test/sql-tap/cast.test.lua > +++ b/test/sql-tap/cast.test.lua > @@ -867,13 +879,14 @@ test:do_test( > -- gh-4356: Check that result of blob to number cast if of type > -- number. 2. This comment could mean the test becomes just wrong and can be deleted. > diff --git a/test/sql-tap/numcast.test.lua b/test/sql-tap/numcast.test.lua > index 56b11da25..a2877167f 100755 > --- a/test/sql-tap/numcast.test.lua > +++ b/test/sql-tap/numcast.test.lua > @@ -149,20 +149,22 @@ test:do_execsql_test( > -- gh-4233: Make sure that NUMBER can contain UNSIGNED, INTEGER > -- and DOUBLE and is not automatically converted to DOUBLE. > -- 3. These tests seem to be quite far from this comment. Perhaps they are broken for some time already. Might worth deleting them. > -test:do_execsql_test( > +test:do_catchsql_test( > "numcast-3.1", > [[ > SELECT CAST(x'3131313131313131313131313131313131313131' AS NUMBER); > ]], { > - 11111111111111111111ULL > + 1, "Type mismatch: can not convert ".. > + "varbinary(x'3131313131313131313131313131313131313131') to number" > }) > > -test:do_execsql_test( > +test:do_catchsql_test( > "numcast-3.2", > [[ > SELECT CAST(x'31313131313131313131313131313131313131312E' AS NUMBER); > ]], { > - 11111111111111110656 > + 1, "Type mismatch: can not convert ".. > + "varbinary(x'31313131313131313131313131313131313131312E') to number" > }) > > test:do_execsql_test( >