From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 dev.tarantool.org (Postfix) with ESMTPS id EC55343D678 for ; Thu, 24 Oct 2019 00:07:09 +0300 (MSK) References: <20191021164528.60675-1-korablev@tarantool.org> From: Vladislav Shpilevoy Message-ID: <93f78bd7-8841-db7a-2fc2-0ffb963a4d7d@tarantool.org> Date: Wed, 23 Oct 2019 23:12:27 +0200 MIME-Version: 1.0 In-Reply-To: <20191021164528.60675-1-korablev@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH] sql: fix off-by-one error in QP List-Id: Tarantool development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Nikita Pettik , tarantool-patches@dev.tarantool.org Hi! Thanks for the patch! LGTM. 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(-) >