From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp58.i.mail.ru (smtp58.i.mail.ru [217.69.128.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A6E0746970E for ; Mon, 30 Dec 2019 03:14:50 +0300 (MSK) Date: Mon, 30 Dec 2019 02:14:48 +0200 From: Nikita Pettik Message-ID: <20191230001448.GD44588@tarantool.org> References: <20191021164528.60675-1-korablev@tarantool.org> <93f78bd7-8841-db7a-2fc2-0ffb963a4d7d@tarantool.org> <20191024081347.GA1453@tarantool.org> <20191229222008.2ttu6ljd2x2cpkb2@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191229222008.2ttu6ljd2x2cpkb2@tkn_work_nb> Subject: Re: [Tarantool-patches] [PATCH] sql: fix off-by-one error in QP List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko Cc: tarantool-patches@dev.tarantool.org, Vladislav Shpilevoy On 30 Dec 01:20, Alexander Turenko wrote: > On Thu, Oct 24, 2019 at 11:13:47AM +0300, Nikita Pettik wrote: > > On 23 Oct 23:12, Vladislav Shpilevoy wrote: > > > Hi! Thanks for the patch! LGTM. > > > > Pushed to master. > > 8fac697 is 2.2.0-543-g8fac69721, so current 2.2 branch possibly affected > by the issue. Shouldn't this commit be cherry picked to 2.2? Yep, let's cherry-pick it to 2.2 (ticket had no milestone at all, so probably I forgot to promote it to 2.2). > > > On 21/10/2019 18:45, Nikita Pettik wrote: > > > > In scope of 8fac697 it was fixed misbehavior while passing floating > > > > point values to integer iterator. Unfortunately, that patch introduced > > > > off-by-one error. Number of constraints (equalities and inequalities) > > > > can not be greater than number of key parts (obviously, each constraint > > > > can be tested against at most one index part). Inequality constraint can > > > > involve only field representing last key part. To get it number of > > > > constraints was used as index. However, since array is 0-based, the last > > > > key part should be calculated as parts[eq_numb - 1]. Before this patch > > > > it was parts[eq_numb]. > > > > > > > > Closes #4558 > > > > --- > > > > Branch: https://github.com/tarantool/tarantool/commits/np/gh-4558-off-by-one-qp-fix > > > > Issue: https://github.com/tarantool/tarantool/issues/4558 > > > > > > > > src/box/sql/wherecode.c | 18 ++++++++++++++---- > > > > 1 file changed, 14 insertions(+), 4 deletions(-) > > > >