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 C30622A3CB for ; Mon, 1 Apr 2019 16:43:44 -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 hMIYEwhKFtP1 for ; Mon, 1 Apr 2019 16:43:44 -0400 (EDT) Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (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 7C9AA29B38 for ; Mon, 1 Apr 2019 16:43:44 -0400 (EDT) From: Stanislav Zudin Subject: [tarantool-patches] Re: [PATCH 08/13] sql: aggregate sql functions support big int References: Message-ID: <90595d90-b329-34bd-74e6-0e60639ed174@tarantool.org> Date: Mon, 1 Apr 2019 23:43:42 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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:13, n.pettik wrote: > > >> On 15 Mar 2019, at 18:45, Stanislav Zudin wrote: >> >> Makes sql functions avg() and sum() accept arguments with >> values in the range [2^63, 2^64). >> --- >> src/box/sql/func.c | 35 ++++++++++++++++++++++++++++++----- >> src/box/sql/sqlInt.h | 3 +++ >> src/box/sql/vdbeapi.c | 6 ++++++ >> 3 files changed, 39 insertions(+), 5 deletions(-) >> >> diff --git a/src/box/sql/func.c b/src/box/sql/func.c >> index 8a8acc216..194dec252 100644 >> --- a/src/box/sql/func.c >> +++ b/src/box/sql/func.c >> @@ -1410,6 +1410,7 @@ struct SumCtx { >> i64 cnt; /* Number of elements summed */ >> u8 overflow; /* True if integer overflow seen */ >> u8 approx; /* True if non-integer value was input to the sum */ >> + u8 is_unsigned; /* True if value exceeded 2^63 */ > > Bool is enough. Done. > >> diff --git a/src/box/sql/sqlInt.h b/src/box/sql/sqlInt.h >> index 7f8e3f04e..c43d8c193 100644 >> --- a/src/box/sql/sqlInt.h >> +++ b/src/box/sql/sqlInt.h >> @@ -495,6 +495,9 @@ sql_result_int(sql_context *, int); >> void >> sql_result_int64(sql_context *, sql_int64); >> >> +void >> +sql_result_uint64(sql_context *, sql_uint64); >> + > > Add test cases verifying that aggregate functions can handle uints. > Done > >