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 1A5FA6EC40; Wed, 18 Aug 2021 22:28:15 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1A5FA6EC40 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1629314895; bh=VWHV5SKRXb+bK5TezM47jnvadcbMGz2ipneNF1xhiLs=; 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=IGY6agGcz87bVv/C4rAluvyi0beC1y66UN52leQNQRwgY9SxJ1zJ4agja/iX2V1YS igggkjdpr7sNt97ycpDiCY217MlbAqgU0fZ3g0utftWpBWgbthvMrj+zL0RepigT7p cSzWhQHmLT4/Givr2RaeaDCwxv63CIp5lM8Gpg6E= 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 DC2E46EC40 for ; Wed, 18 Aug 2021 22:28:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DC2E46EC40 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1mGRET-0004ik-0I; Wed, 18 Aug 2021 22:28:13 +0300 Date: Wed, 18 Aug 2021 22:03:02 +0300 To: Mergen Imeev Cc: tarantool-patches@dev.tarantool.org Message-ID: <20210818190302.GH5743@tarantool.org> References: <20210818171840.GG5743@tarantool.org> <20210818190432.GA696969@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210818190432.GA696969@tarantool.org> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.10.1 (2018-07-13) X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD92087353F0EC44DD910164DC12A5633065676A9727AC27C74182A05F53808504074136C47093E58CF3F196F96B83442E33AF2EBFF695AB836AFD7BFA8E18D187E X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7AC4684DF4EC4B256EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063771C846A5973DEE7E8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D84E226A46E070CBB2AB999D4ACAFBF34D117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCF1175FABE1C0F9B6A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352033AC447995A7AD182CC0D3CB04F14752D2E47CDBA5A96583BA9C0B312567BB231DD303D21008E29813377AFFFEAFD269A417C69337E82CC2E827F84554CEF50127C277FBC8AE2E8BA83251EDC214901ED5E8D9A59859A8B6BF3059D42242344A089D37D7C0E48F6C5571747095F342E88FB05168BE4CE3AF X-C1DE0DAB: 0D63561A33F958A59F3FD3907F897FA70488734792F5BF0E5FA3B338B835E598D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75C29D03FC76C37677410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D341776B9FDE05FBA7A417E9F0DF31DD2364BCA01DD9BA404283761ED7959C4434DECBF0D3804E137D31D7E09C32AA3244CAE38679081A63019E75CAC8A7872DC3181560E2432555DBBFACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojGSxK+6r6oBEpmtHH32vD3A== X-Mailru-Sender: 689FA8AB762F7393C37E3C1AEC41BA5D9DC7BBE7F85B4659C5C05E8D10F45A84A7C8D0F45F857DBFE9F1EFEE2F478337FB559BB5D741EB964C8C2C849690F8E70A04DAD6CC59E33667EA787935ED9F1B 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 fixes! The new patch below LGTM. I also tested the fix on my M1 machine, and the issue is gone. JFYI, the whole sql-tap suite works fine after your patch (with all LuaJIT-related patched applied). On 18.08.21, Mergen Imeev wrote: > Hi! Thank you for the review! My answers and new patch below. I did not include > diff, since most of changes were in commit-message and there were only couple > changes lines in the test. > > On Wed, Aug 18, 2021 at 08:18:40PM +0300, Igor Munkin wrote: > > > 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? > > > Added check with typeof. I see no sense to add check with metadata, since there > we will see "string". It will be fixed in patch-set about SQL built-in > functions. Great, thanks! > > > > + }) > > > + > > > +test:finish_test() > > > 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? > > > Yes. Got it, thanks! > > > > + - [18000000000000000000] > > > ... > > > box.execute("SELECT LEAST(d, 0) FROM t;") > > > --- > > > -- > > > 2.25.1 > > > > > > > -- > > Best regards, > > IM > > > New patch: > > > commit 2e2d979c53be8d9f97071d3003e1069fc8c078cf > Author: Mergen Imeev > Date: Fri Aug 13 05:50:06 2021 +0300 > > sql: fix quote() function > > Ater this patch SQL built-in function QUOTE() will return argument in Typo: s/Ater/After/. > case DOUBLE values is given. If the argument is not number, string Typo: s/values/value/. > representation of the argument will be returned. > > Closes #6239 > > @TarantoolBot document > Title: QUOTE() and DOUBLE argument > > After this patch function QUOTE() will return argument in case it > receives DOUBLE value as an argument. The same for all other numeric > types. In case it was given value of non-numeric type, it will return > string representation of the argument. > > --- -- Best regards, IM