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 A1EEC2A52C for ; Mon, 1 Apr 2019 16:38:22 -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 kE_YuD9EQPLi for ; Mon, 1 Apr 2019 16:38:22 -0400 (EDT) Received: from smtp20.mail.ru (smtp20.mail.ru [94.100.179.251]) (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 5AAEA2A517 for ; Mon, 1 Apr 2019 16:38:22 -0400 (EDT) From: Stanislav Zudin Subject: [tarantool-patches] Re: [PATCH 00/13] sql: support -2^63 .. 2^64-1 integer type References: <94914AB5-F2EB-4FB5-BDA9-67E01B10D18A@tarantool.org> Message-ID: <087d6d84-7850-2e12-0b24-9ed6d1aa8301@tarantool.org> Date: Mon, 1 Apr 2019 23:38:19 +0300 MIME-Version: 1.0 In-Reply-To: <94914AB5-F2EB-4FB5-BDA9-67E01B10D18A@tarantool.org> Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit 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, "n.pettik" On 25.03.2019 18:10, n.pettik wrote: > > >> On 15 Mar 2019, at 18:45, Stanislav Zudin 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}) > > > >