[Tarantool-patches] [PATCH] sql: fix off-by-one error while setting bind names

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Wed Feb 5 00:36:00 MSK 2020


Hi!

Thanks for the patch, LGTM.

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


More information about the Tarantool-patches mailing list