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 431A06EC40; Wed, 18 Aug 2021 20:43:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 431A06EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629308633; bh=8vgUNAMoyc8+Cj+6LDvJ3jTOYJVwZ3ZadjjbC2OpnvY=; h=Date:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Z6zxWB2w64qmF6utJFRVVVuGOg/qYHEaD+cxqxoZ+Od1Pfp0mMT9IpCcoJd9t7bOy pFnq1JxNQCze0MW2R2VKXEuQIL1oOxlJw1+BUKCi8DxXgVFa9aOQ/jZ40mbFJjtdg6 0nUB7moFeBTzDm/s9SwYCBVtJcB3J8IZ0LwcECME= 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 AB3B36EC40 for ; Wed, 18 Aug 2021 20:43:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AB3B36EC40 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1mGPbS-0000Bl-OV; Wed, 18 Aug 2021 20:43:51 +0300 Date: Wed, 18 Aug 2021 20:18:40 +0300 To: imeevma@tarantool.org Cc: tarantool-patches@dev.tarantool.org Message-ID: <20210818171840.GG5743@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD9736CF3E71F18CE0C3E1D5927724F4AAA182A05F5380850407D383A1B974B6F40A894295B2F4C1210FFD7476DFAD6415B9016800E91500553 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77F4CDA15A4A01EA0EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637C8D8BCCD49BBA39A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D8FE2E1BC436DE24CF53D89112498905F4117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCECADA55FE5B58BB7A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD1828451B159A507268D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6BF3059D42242344A089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A56052FCF54A10F84298FB0A53159F0734C90D00F091B4840ED59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75C29D03FC76C37677410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3473457D764E1CDE771588A2D4B07549725389DE9D90C9526ADFD223C0980FEB2F3263D427EC16B2A61D7E09C32AA3244CF466DBCD229C35FD4A7CEA1C0CAB6D01F2F5F14F68F1805BFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBF+wh7Y+31Qdg== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5DEAA2A92A02F1182C50306719DF5F9336A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v1 1/1] sql: fix quote() function 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: Igor Munkin via Tarantool-patches Reply-To: Igor Munkin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Mergen, Thanks for the patch! Please consider minor comments below. On 17.08.21, imeevma@tarantool.org wrote: > Ater this patch SQL built-in function QUOTE() will return the same > DOUBLE in case it receives DOUBLE as an argument. If the argument is Minor: it's better to say QUOTE() returns the argument in case DOUBLE value is given. Since we're here: do we need a docbot request for this? > not number, string representation of the argument will be returned. > > Closes #6239 > --- > https://github.com/tarantool/tarantool/issues/6239 > https://github.com/tarantool/tarantool/tree/imeevma/gh-6239-quote-with-double-arg > > src/box/sql/func.c | 15 +-------------- > test/sql-tap/engine.cfg | 3 +++ > .../gh-6239-quote-with-double-arg.test.lua | 14 ++++++++++++++ > test/sql-tap/trigger5.test.lua | 3 ++- > test/sql/types.result | 8 ++++---- > 5 files changed, 24 insertions(+), 19 deletions(-) > create mode 100755 test/sql-tap/gh-6239-quote-with-double-arg.test.lua > > diff --git a/test/sql-tap/gh-6239-quote-with-double-arg.test.lua b/test/sql-tap/gh-6239-quote-with-double-arg.test.lua > new file mode 100755 > index 000000000..60f85f20f > --- /dev/null > +++ b/test/sql-tap/gh-6239-quote-with-double-arg.test.lua > @@ -0,0 +1,14 @@ > +#!/usr/bin/env tarantool > +local test = require("sqltester") > +test:plan(1) > + > +-- Make sure that QUOTE() returns DOUBLE in cast it receives DOUBLE. > +test:do_execsql_test( > + "gh-6239", > + [[ > + SELECT QUOTE(1.5); > + ]], { > + 1.5 Do we need to check QUOTE preserves the type of the argument? > + }) > + > +test:finish_test() > diff --git a/test/sql-tap/trigger5.test.lua b/test/sql-tap/trigger5.test.lua > index 8336cdcf2..7f3762126 100755 > --- a/test/sql-tap/trigger5.test.lua > +++ b/test/sql-tap/trigger5.test.lua > @@ -31,7 +31,8 @@ test:do_execsql_test( > INSERT INTO Undo VALUES > ((SELECT coalesce(max(id),0) + 1 FROM Undo), > (SELECT 'INSERT INTO Item (a,b,c) VALUES (' || CAST(coalesce(old.a,'NULL') AS TEXT) > - || ',' || quote(old.b) || ',' || CAST(old.c AS TEXT) || ');')); > + || ',' || CAST(quote(old.b) AS STRING) || ',' || > + CAST(old.c AS TEXT) || ');')); [Hm. Expecting nothing is completely broken, since test results are not changed.] > END; > DELETE FROM Item WHERE a = 1; > SELECT * FROM Undo; > diff --git a/test/sql/types.result b/test/sql/types.result > index 07d5b46e4..358667e94 100644 > --- a/test/sql/types.result > +++ b/test/sql/types.result > @@ -1908,10 +1908,10 @@ box.execute("SELECT quote(d) FROM t;") > - name: COLUMN_1 > type: string > rows: > - - ['10.0'] > - - ['-2.0'] > - - ['3.3'] > - - ['1.8e+19'] > + - [10] > + - [-2] > + - [3.3] Fraction is dropped by YAML serializer, right? > + - [18000000000000000000] > ... > box.execute("SELECT LEAST(d, 0) FROM t;") > --- > -- > 2.25.1 > -- Best regards, IM