From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 0D32246970E for ; Thu, 6 Feb 2020 20:30:18 +0300 (MSK) Date: Thu, 6 Feb 2020 20:30:18 +0300 From: Nikita Pettik Message-ID: <20200206173018.GB27490@tarantool.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH] sql: fix off-by-one error while setting bind names List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org On 04 Feb 22:36, Vladislav Shpilevoy wrote: > Hi! > > Thanks for the patch, LGTM. Pushed to master and 2.3 > On 04/02/2020 18:12, Nikita Pettik wrote: > > Names of bindings are stored in the array indexed from 1 (see struct > > Vdbe->pVList). So to get name of i-th values to be bound, one should > > call sqlVListNumToName(list, i+1) not sqlVListNumToName(list, i). > > For this reason, names of binding parameters returned in meta-information > > in response to :prepare() call are shifted by one. Let's fix it and > > calculate position of binding parameter taking into consideration > > 1-based indexing. > > > > Closes #4760 > > --- > > Branch: https://github.com/tarantool/tarantool/commits/np/gh-4760-off-by-one-bind > > Issue: https://github.com/tarantool/tarantool/issues/4760