From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp31.i.mail.ru (smtp31.i.mail.ru [94.100.177.91]) (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 1329B469719 for ; Tue, 11 Feb 2020 02:25:00 +0300 (MSK) References: <8e0dd524221265bfba1906e1bc6fb0608b1f0c45.1580841722.git.korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Tue, 11 Feb 2020 00:24:58 +0100 MIME-Version: 1.0 In-Reply-To: <8e0dd524221265bfba1906e1bc6fb0608b1f0c45.1580841722.git.korablev@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 3/4] sql: fix CAST AS NUMBER operator List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik , tarantool-patches@dev.tarantool.org Thanks for the patch! See 5 comments below. > diff --git a/test/sql-tap/cast.test.lua b/test/sql-tap/cast.test.lua > index 9c937a065..a3f0bc787 100755 > --- a/test/sql-tap/cast.test.lua > +++ b/test/sql-tap/cast.test.lua > @@ -663,14 +663,14 @@ test:do_execsql_test( > SELECT CAST(-9223372036854774800 AS NUMBER) > ]], { > -- > - -9223372036854774784 > + -9223372036854774800LL > -- > }) > > test:do_execsql_test( > "cast-3.7", > "SELECT CAST(-9223372036854774800 AS NUMBER)", > - {-9.22337203685477e+18}) > + {-9223372036854774800LL}) 1. 3.6 and 3.7 are the same. I propose to drop one. > test:do_execsql_test( > "cast-3.8", > @@ -705,12 +705,12 @@ test:do_execsql_test( > test:do_execsql_test( > "cast-3.13", > "SELECT CAST(9223372036854774800 AS NUMBER)", > - {9.22337203685477e+18}) > + {9223372036854774800LL}) 2. 3.2, 3.3 and 3.13 are exactly the same. I propose to keep only one. > @@ -732,7 +732,7 @@ test:do_execsql_test( > test:do_execsql_test( > "cast-3.16", > [[ > - SELECT CAST('-9223372036854774800' AS NUMBER) > + SELECT CAST('-9223372036854774800.' AS NUMBER) > ]], { > -- > -9223372036854774784 3. 3.16 and 3.17 are the same. Lets drop one. > @@ -778,7 +778,7 @@ if true then --test:execsql("PRAGMA encoding")[1][1]=="UTF-8" then > }) > test:do_execsql_test( > "cast-3.23", > - "SELECT CAST(x'39323233333732303336383534373734383030' AS NUMBER)", > + "SELECT CAST(x'393232333337323033363835343737343830302E' AS NUMBER)", > {9.22337203685477e+18}) 4. 3.22 and 3.23 are the same. Drop one, please. > test:do_execsql_test( > @@ -788,7 +788,7 @@ if true then --test:execsql("PRAGMA encoding")[1][1]=="UTF-8" then > AS integer) > ]], { > -- > - 9223372036854774784LL > + 9223372036854774800LL 5. Indentation is a bit off. > -- > }) > end