From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 2 Apr 2019 10:57:07 +0300 From: Konstantin Osipov Subject: Re: [tarantool-patches] [PATCH 08/13] sql: aggregate sql functions support big int Message-ID: <20190402075707.GH25072@chai> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: tarantool-patches@freelists.org Cc: vdavydov.dev@gmail.com, Stanislav Zudin List-ID: * Stanislav Zudin [19/03/15 22:09]: > if (type == SQL_INTEGER) { > - i64 v = sql_value_int64(argv[0]); > + v = sql_value_int64(argv[0]); > p->rSum += v; > - if ((p->approx | p->overflow) == 0 > - && sqlAddInt64(&p->iSum, true, v, true) != ATHR_SIGNED) { > - p->overflow = 1; > - } > + is_signed = true; > + } else if (type == SQL_UNSIGNED) { > + v = sql_value_int64(argv[0]); > + p->rSum += (u64)v; > + is_signed = false; Perhaps I am missing something in this patch, but where did overflow check go? How does this work if p->rSum contains a negative value? -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov