From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp50.i.mail.ru (smtp50.i.mail.ru [94.100.177.110]) (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 6A24042EF5C for ; Thu, 11 Jun 2020 23:14:09 +0300 (MSK) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) From: Chris Sosnin In-Reply-To: <2458dc72-22ed-2618-00b0-c80bfc47333f@tarantool.org> Date: Thu, 11 Jun 2020 23:14:08 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: <74B0656A-4DAF-411E-8279-3188C6217CEF@tarantool.org> References: <401a596ba9864ddf4ffc687f4313a60dbc664a28.1591371404.git.k.sosnin@tarantool.org> <2458dc72-22ed-2618-00b0-c80bfc47333f@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/2] Allow leading and trailing whitespaces in FromString List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: tarantool-patches@dev.tarantool.org Hi! Thank you for the review! > On 11 Jun 2020, at 20:06, Vladislav Shpilevoy = wrote: >=20 > Hi! Thanks for the patch! >=20 > I am afraid this may be a dead end. You didn't check for tabs, new = lines, > \r, and whatever else can be treated as a whitespace. Moreover, for = some other > code it may be necessary not to skip whitespaces. Why can't you trim = whitespace > symbols in SQL code? sql_atoi64(), for example, trims them, before = calling > strtoll()/strtoull(). I made this change here to unify the behavior, but perhaps this makes = sense only in SQL? In this case I can make a wrapper similar to sql_atoi64() you mentioned. = And if I understand correctly, I should use isspace instead of char comparison. >=20 > To trim right spaces you could make this function return a position = where > did it stop, so as to ensure that all the rest is whitespaces, in SQL = code. > That also would be consistent with strtoll()/strtoull(). I like this idea, will work on it in v2.=