Tarantool development patches archive
 help / color / mirror / Atom feed
From: Stanislav Zudin <szudin@tarantool.org>
To: tarantool-patches@freelists.org, korablev@tarantool.org
Cc: Stanislav Zudin <szudin@tarantool.org>
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	[thread overview]
Message-ID: <a57cb3a120ce2f8e361d4873e09a2e8bd592c053.1554150265.git.szudin@tarantool.org> (raw)
In-Reply-To: <cover.1554150265.git.szudin@tarantool.org>
In-Reply-To: <cover.1554150265.git.szudin@tarantool.org>

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(
         -- </func-18.12>
     })
 
+
 test:do_execsql_test(
     "func-18.13",
     [[
@@ -1612,6 +1613,17 @@ test:do_execsql_test(
         -- </func-18.13>
     })
 
+test:do_execsql_test(
+        "func-18.12a",
+        [[
+            INSERT INTO t6 VALUES(4, 13+ (1<<62));
+            SELECT avg(x) from t6;
+        ]], {
+            -- <func-18.12>
+            3458764513820540928
+            -- </func-18.12>
+        })
+
 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

  parent reply	other threads:[~2019-04-01 20:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 20:44 [tarantool-patches] [PATCH v2 00/15] " Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 01/15] sql: Convert big integers from string Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 02/15] sql: make VDBE recognize big integers Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 03/15] sql: removes unused function Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 04/15] sql: support big integers within sql binding Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 05/15] sql: removes redundant function Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 06/15] sql: arithmetic functions support big integers Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 07/15] sql: aggregate sql functions support big int Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 08/15] sql: fixes errors Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 09/15] sql: support -2^63 .. 2^64-1 integer type Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 10/15] " Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 11/15] " Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 12/15] " Stanislav Zudin
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 13/15] " Stanislav Zudin
2019-04-01 20:44 ` Stanislav Zudin [this message]
2019-04-01 20:44 ` [tarantool-patches] [PATCH v2 15/15] " Stanislav Zudin
2019-04-02 16:54 ` [tarantool-patches] Re: [PATCH v2 00/15] " n.pettik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a57cb3a120ce2f8e361d4873e09a2e8bd592c053.1554150265.git.szudin@tarantool.org \
    --to=szudin@tarantool.org \
    --cc=korablev@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v2 14/15] sql: support -2^63 .. 2^64-1 integer type' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox