From: Stanislav Zudin <szudin@tarantool.org>
To: tarantool-patches@freelists.org, "n.pettik" <korablev@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 00/13] sql: support -2^63 .. 2^64-1 integer type
Date: Mon, 1 Apr 2019 23:38:19 +0300 [thread overview]
Message-ID: <087d6d84-7850-2e12-0b24-9ed6d1aa8301@tarantool.org> (raw)
In-Reply-To: <94914AB5-F2EB-4FB5-BDA9-67E01B10D18A@tarantool.org>
On 25.03.2019 18:10, n.pettik wrote:
>
>
>> On 15 Mar 2019, at 18:45, Stanislav Zudin <szudin@tarantool.org> wrote:
>>
>> The patch enables support of big integers in the range [2^63, 2^64-1].
>> Conversion functions use return value to inform about value
>> they return - signed integer in the range [-2^63,2^63-1] or
>> unsigned integer in the range [2^63, 2^64 -1].
>> The changes affect sql processing, VDBE, arithmetic functions and
>> aggregate functions.
>
> I see a lot of commits below, so it would be nice to see
> some details concerning your plan of implementation.
>
>> Issue: https://github.com/tarantool/tarantool/issues/3810
>> Branch: https://github.com/tarantool/tarantool/tree/stanztt/gh-3810-sql-uint64-support
>
> I didn’t dive into your patches yet, but I’ve come up with
> simple and strange cases:
>
> tarantool> CREATE TABLE t (id INT PRIMARY KEY, a INT);
> tarantool> box.space.T:insert{1, 18446744073709551615ULL}
> ---
> - [1, 18446744073709551615]
> …
> tarantool> SELECT a*1 FROM t;
> ---
> - error: 'Failed to execute SQL statement: integer is overflowed'
> ...
> tarantool> select a from t;
> ---
> - - [18446744073709551615]
> …
>
> Or:
>
> tarantool> select -9223372036854775808*(-1)
> ---
> - error: 'Failed to execute SQL statement: integer is overflowed'
> ...
Fixed.
>
> Second example:
>
> tarantool> format = {}
> tarantool> format[1] = {'a', 'integer'}
> tarantool> format[2] = {'b', 'unsigned’}
>
> tarantool> box.schema.space.create('T1', {format = format})
> tarantool> box.space.T1:create_index('pk', {parts = {{'a'}}})
>
> tarantool> box.sql.execute("insert into t1 values(18446744073709551615, 18446744073709551615)")
> ---
> ...
>
> tarantool> box.sql.execute("select * from t1")
> ---
> - - [-1, 18446744073709551615]
> …
Fixed.
The correct output is following:
tarantool> box.sql.execute("select * from t1")
---
- - [18446744073709551615, 18446744073709551615]
...
>
> I expected that mentioned insertion would be equal to this one:
>
> box.space.T1:insert({18446744073709551615ULL, 18446744073709551615ULL})
>
> But instead, it is the same as:
>
> box.space.T1:insert({18446744073709551615LL, 18446744073709551615ULL})
>
>
>
>
prev parent reply other threads:[~2019-04-01 20:38 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-15 15:45 Stanislav Zudin
2019-03-15 15:45 ` [PATCH 01/13] sql: Convert big integers from string Stanislav Zudin
2019-03-25 15:10 ` [tarantool-patches] " n.pettik
2019-04-01 20:39 ` Stanislav Zudin
2019-04-02 7:27 ` Konstantin Osipov
2019-03-15 15:45 ` [PATCH 02/13] sql: make VDBE recognize big integers Stanislav Zudin
2019-03-25 15:11 ` [tarantool-patches] " n.pettik
2019-04-01 20:42 ` Stanislav Zudin
2019-04-02 7:38 ` [tarantool-patches] " Konstantin Osipov
2019-03-15 15:45 ` [PATCH 03/13] sql: removes unused function Stanislav Zudin
2019-03-25 15:11 ` [tarantool-patches] " n.pettik
2019-04-01 20:39 ` Stanislav Zudin
2019-03-15 15:45 ` [PATCH 04/13] sql: support big integers within sql binding Stanislav Zudin
2019-03-25 15:12 ` [tarantool-patches] " n.pettik
2019-04-01 20:42 ` Stanislav Zudin
2019-04-02 7:46 ` Konstantin Osipov
2019-04-02 7:44 ` [tarantool-patches] " Konstantin Osipov
2019-03-15 15:45 ` [PATCH 05/13] sql: removes redundant function Stanislav Zudin
2019-03-25 15:12 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 06/13] sql: aux functions to support big integers Stanislav Zudin
2019-03-25 15:13 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 07/13] sql: arithmetic functions " Stanislav Zudin
2019-03-25 15:13 ` [tarantool-patches] " n.pettik
2019-04-01 20:43 ` Stanislav Zudin
2019-04-02 7:54 ` Konstantin Osipov
2019-04-02 7:52 ` Konstantin Osipov
2019-03-15 15:45 ` [PATCH 08/13] sql: aggregate sql functions support big int Stanislav Zudin
2019-03-25 15:13 ` [tarantool-patches] " n.pettik
2019-04-01 20:43 ` Stanislav Zudin
2019-04-02 7:57 ` [tarantool-patches] " Konstantin Osipov
2019-03-15 15:45 ` [PATCH 09/13] sql: fixes errors Stanislav Zudin
2019-03-25 15:14 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 10/13] sql: fixes an error in sqlSubInt64 Stanislav Zudin
2019-03-25 15:14 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 11/13] sql: fixes an error in string to int64 conversion Stanislav Zudin
2019-03-25 15:14 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 12/13] sql: fixes an error in uint64 to double casting Stanislav Zudin
2019-03-25 15:15 ` [tarantool-patches] " n.pettik
2019-03-15 15:45 ` [PATCH 13/13] sql: support -2^63 .. 2^64-1 integer type Stanislav Zudin
2019-03-25 15:25 ` [tarantool-patches] " n.pettik
2019-04-01 20:44 ` Stanislav Zudin
2019-03-25 15:10 ` [tarantool-patches] Re: [PATCH 00/13] " n.pettik
2019-04-01 20:38 ` Stanislav Zudin [this message]
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=087d6d84-7850-2e12-0b24-9ed6d1aa8301@tarantool.org \
--to=szudin@tarantool.org \
--cc=korablev@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH 00/13] 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