[Tarantool-patches] [PATCH 4/4] sql: do not force FP representation for NUMBER field

Nikita Pettik korablev at tarantool.org
Tue Feb 11 17:14:45 MSK 2020


On 11 Feb 00:24, Vladislav Shpilevoy wrote:
> Thanks for the patch, Mergen too!
> 
> > diff --git a/test/sql-tap/numcast.test.lua b/test/sql-tap/numcast.test.lua
> > index 87c5f6b35..f795cef75 100755
> > --- a/test/sql-tap/numcast.test.lua
> > +++ b/test/sql-tap/numcast.test.lua
> > @@ -191,4 +191,64 @@ test:do_execsql_test(
> >          10, 10
> >      })
> >  
> > +test:do_execsql_test(
> > +    "numcast-3.6",
> > +    [[
> > +        CREATE TABLE t1 (id INT PRIMARY KEY, n NUMBER);
> > +        INSERT INTO t1 VALUES (1, 9223372036854775807);
> > +        INSERT INTO t1 VALUES (2, -9223372036854775807);
> > +        INSERT INTO t1 VALUES (3, 9223372036854775807.1);
> > +        SELECT n, n/100 FROM t1;
> > +    ]], {
> > +        9223372036854775807ULL, 92233720368547758ULL,
> > +        -9223372036854775807LL, -92233720368547758LL,
> > +        9223372036854775808, 92233720368547758.08
> 
> Could you please select smaller values for the test, in
> case the big values don't matter here? Because
> 9223372036854775807.1 turned into 9223372036854775808 looks
> confusing.

Ok:

diff --git a/test/sql-tap/numcast.test.lua b/test/sql-tap/numcast.test.lua
index f795cef75..eeac5353a 100755
--- a/test/sql-tap/numcast.test.lua
+++ b/test/sql-tap/numcast.test.lua
@@ -197,12 +197,12 @@ test:do_execsql_test(
         CREATE TABLE t1 (id INT PRIMARY KEY, n NUMBER);
         INSERT INTO t1 VALUES (1, 9223372036854775807);
         INSERT INTO t1 VALUES (2, -9223372036854775807);
-        INSERT INTO t1 VALUES (3, 9223372036854775807.1);
+        INSERT INTO t1 VALUES (3, 9007199254740992.0);
         SELECT n, n/100 FROM t1;
     ]], {
         9223372036854775807ULL, 92233720368547758ULL,
         -9223372036854775807LL, -92233720368547758LL,
-        9223372036854775808, 92233720368547758.08
+        9007199254740992, 90071992547409.92
     })



More information about the Tarantool-patches mailing list