From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id D1A6629B67 for ; Mon, 25 Mar 2019 11:25:25 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eNvS23aFide5 for ; Mon, 25 Mar 2019 11:25:25 -0400 (EDT) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 8C3E029B27 for ; Mon, 25 Mar 2019 11:25:25 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH 13/13] sql: support -2^63 .. 2^64-1 integer type From: "n.pettik" In-Reply-To: Date: Mon, 25 Mar 2019 18:25:22 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: tarantool-patches@freelists.org Cc: szudin@tarantool.org Merge this patch with the main one in your patch-set. Also, please add sufficient number of tests verifying that INT in a range of [2^63, 2^64 - 1] is working without as designed > Closes #3810 > --- > test/sql-tap/func.test.lua | 6 +++--- > test/sql-tap/hexlit.test.lua | 6 ++++-- > test/sql/gh-2347-max-int-literals.result | 2 +- > test/sql/integer-overflow.result | 10 +++++----- > test/sql/iproto.result | 11 +++++++---- > test/sql/iproto.test.lua | 5 ++--- > 6 files changed, 22 insertions(+), 18 deletions(-) >=20 > diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua > index 889fc5867..8e75f9c89 100755 > --- a/test/sql-tap/func.test.lua > +++ b/test/sql-tap/func.test.lua > @@ -1591,14 +1591,14 @@ test:do_execsql_test( > -- > }) >=20 > -test:do_catchsql_test( > +test:do_execsql_test( > "func-18.12", > [[ > INSERT INTO t6 VALUES(3, 1<<62); > SELECT sum(x) - ((1<<62)*2.0+1) from t6; > ]], { > -- > - 1, "integer overflow" > + 0 tarantool> SELECT sum(x) from t6; --- - - [9223372036854775809] ... tarantool> SELECT ((1<<62)*2.0+1) from t6; --- - - [9223372036854775808] - [9223372036854775808] - [9223372036854775808] =E2=80=A6 So, how it could be that SELECT sum(x) - ((1<<62)*2.0+1) is 0? What is more, I see this: tarantool> SELECT typeof(sum(x)) from t6; --- - - ['null'] =E2=80=A6 Which is obviously wrong. > diff --git a/test/sql-tap/hexlit.test.lua = b/test/sql-tap/hexlit.test.lua > index 158eda73b..1597d4b8a 100755 > --- a/test/sql-tap/hexlit.test.lua > +++ b/test/sql-tap/hexlit.test.lua > @@ -1,6 +1,6 @@ > #!/usr/bin/env tarantool > test =3D require("sqltester") > -test:plan(128) > +test:plan(130) >=20 > --!./tcltestrunner.lua > -- 2014-07-23 > @@ -91,7 +91,9 @@ hexlit1(160, "0X1000000000000000", = 1152921504606846976LL) > hexlit1(161, "0x2000000000000000", 2305843009213693952LL) > hexlit1(162, "0X4000000000000000", 4611686018427387904LL) > hexlit1(163, "0x8000000000000000", -9223372036854775808LL) > -hexlit1(164, "0XFFFFFFFFFFFFFFFF", -1) > +hexlit1(164, "0x8000000000000000", 9223372036854775808ULL) > +hexlit1(165, "0x8000000000000001", 9223372036854775809ULL) > +hexlit1(166, "0XFFFFFFFFFFFFFFFF", 18446744073709551615ULL) > for n =3D 1, 0x10 -1, 1 do > hexlit1("200."..n..".1", "0X"..string.format("%03X",n), n) > hexlit1("200."..n..".2", "0x"..string.format("%03X",n), n) > diff --git a/test/sql/gh-2347-max-int-literals.result = b/test/sql/gh-2347-max-int-literals.result > index c289a80fe..e6f78d244 100644 > --- a/test/sql/gh-2347-max-int-literals.result > +++ b/test/sql/gh-2347-max-int-literals.result > @@ -20,7 +20,7 @@ box.sql.execute("select (-9223372036854775808)") > ... > box.sql.execute("select (9223372036854775808)") > --- > -- error: 'oversized integer: 9223372036854775808' > +- - [9223372036854775808] Please, make these test check that overflow error is handled, not simply fixing result file.