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 7822E29C02 for ; Mon, 25 Mar 2019 11:10:51 -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 rEPjikzAEZpe for ; Mon, 25 Mar 2019 11:10:51 -0400 (EDT) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.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 BB25429B67 for ; Mon, 25 Mar 2019 11:10:50 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: [tarantool-patches] Re: [PATCH 00/13] sql: support -2^63 .. 2^64-1 integer type From: "n.pettik" In-Reply-To: Date: Mon, 25 Mar 2019 18:10:47 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <94914AB5-F2EB-4FB5-BDA9-67E01B10D18A@tarantool.org> 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 Cc: szudin@tarantool.org > On 15 Mar 2019, at 18:45, Stanislav Zudin = wrote: >=20 > 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=20 > 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-sup= port I didn=E2=80=99t dive into your patches yet, but I=E2=80=99ve 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] =E2=80=A6 tarantool> SELECT a*1 FROM t; --- - error: 'Failed to execute SQL statement: integer is overflowed' ... tarantool> select a from t; --- - - [18446744073709551615] =E2=80=A6 Or: tarantool> select -9223372036854775808*(-1) --- - error: 'Failed to execute SQL statement: integer is overflowed' ... Second example: tarantool> format =3D {} tarantool> format[1] =3D {'a', 'integer'} tarantool> format[2] =3D {'b', 'unsigned=E2=80=99} tarantool> box.schema.space.create('T1', {format =3D format}) tarantool> box.space.T1:create_index('pk', {parts =3D {{'a'}}}) tarantool> box.sql.execute("insert into t1 values(18446744073709551615, = 18446744073709551615)") --- ... tarantool> box.sql.execute("select * from t1") --- - - [-1, 18446744073709551615] =E2=80=A6 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})