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 596352A527 for ; Mon, 1 Apr 2019 16:45:13 -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 z9TuZadq31cf for ; Mon, 1 Apr 2019 16:45:13 -0400 (EDT) Received: from smtp18.mail.ru (smtp18.mail.ru [94.100.176.155]) (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 04ABC2A400 for ; Mon, 1 Apr 2019 16:45:13 -0400 (EDT) From: Stanislav Zudin Subject: [tarantool-patches] [PATCH v2 14/15] sql: support -2^63 .. 2^64-1 integer type Date: Mon, 1 Apr 2019 23:44:52 +0300 Message-Id: In-Reply-To: References: In-Reply-To: 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, korablev@tarantool.org Cc: Stanislav Zudin Adds tests. Part of #3810 --- test/sql-tap/func.test.lua | 14 +++++++++++++- test/sql/gh-2347-max-int-literals.result | 9 +++++++++ test/sql/gh-2347-max-int-literals.test.lua | 4 ++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua index c77b183db..1f328edb4 100755 --- a/test/sql-tap/func.test.lua +++ b/test/sql-tap/func.test.lua @@ -1,6 +1,6 @@ #!/usr/bin/env tarantool test = require("sqltester") -test:plan(14586) +test:plan(14587) --!./tcltestrunner.lua -- 2001 September 15 @@ -1602,6 +1602,7 @@ test:do_execsql_test( -- }) + test:do_execsql_test( "func-18.13", [[ @@ -1612,6 +1613,17 @@ test:do_execsql_test( -- }) +test:do_execsql_test( + "func-18.12a", + [[ + INSERT INTO t6 VALUES(4, 13+ (1<<62)); + SELECT avg(x) from t6; + ]], { + -- + 3458764513820540928 + -- + }) + test:do_execsql_test( "func-18.14", [[ diff --git a/test/sql/gh-2347-max-int-literals.result b/test/sql/gh-2347-max-int-literals.result index e6f78d244..f12fab708 100644 --- a/test/sql/gh-2347-max-int-literals.result +++ b/test/sql/gh-2347-max-int-literals.result @@ -26,3 +26,12 @@ box.sql.execute("select (-9223372036854775809)") --- - error: 'oversized integer: -9223372036854775809' ... +-- cause an overflow +box.sql.execute("select (92233720368547758080)") +--- +- error: 'oversized integer: 92233720368547758080' +... +box.sql.execute("select (-92233720368547758090)") +--- +- error: 'oversized integer: -92233720368547758090' +... diff --git a/test/sql/gh-2347-max-int-literals.test.lua b/test/sql/gh-2347-max-int-literals.test.lua index 4b1ef0d4f..7106158a9 100644 --- a/test/sql/gh-2347-max-int-literals.test.lua +++ b/test/sql/gh-2347-max-int-literals.test.lua @@ -9,3 +9,7 @@ box.sql.execute("select (-9223372036854775808)") box.sql.execute("select (9223372036854775808)") box.sql.execute("select (-9223372036854775809)") + +-- cause an overflow +box.sql.execute("select (92233720368547758080)") +box.sql.execute("select (-92233720368547758090)") -- 2.17.1