Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Chris Sosnin <k.sosnin@tarantool.org>,
	tarantool-patches@dev.tarantool.org, sergepetrenko@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/2] Allow leading and trailing whitespaces in FromString
Date: Thu, 11 Jun 2020 19:06:49 +0200	[thread overview]
Message-ID: <2458dc72-22ed-2618-00b0-c80bfc47333f@tarantool.org> (raw)
In-Reply-To: <401a596ba9864ddf4ffc687f4313a60dbc664a28.1591371404.git.k.sosnin@tarantool.org>

Hi! Thanks for the patch!

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().

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().

  parent reply	other threads:[~2020-06-11 17:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 15:41 [Tarantool-patches] [PATCH 0/2] update decNumber for SQL Chris Sosnin
2020-06-05 15:41 ` [Tarantool-patches] [PATCH 1/2] Allow leading and trailing whitespaces in FromString Chris Sosnin
2020-06-06 13:48   ` Serge Petrenko
2020-06-07 12:38     ` Chris Sosnin
2020-06-11 17:06   ` Vladislav Shpilevoy [this message]
2020-06-11 20:14     ` Chris Sosnin
2020-06-05 15:41 ` [Tarantool-patches] [PATCH 2/2] Add IsWhole method for checking the fractional part of a number Chris Sosnin
2020-06-06 14:17   ` Serge Petrenko
2020-06-07 12:40     ` Chris Sosnin
2020-06-08  8:59       ` Serge Petrenko
2020-06-11 17:06   ` Vladislav Shpilevoy
2020-06-11 20:30     ` Chris Sosnin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2458dc72-22ed-2618-00b0-c80bfc47333f@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=k.sosnin@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/2] Allow leading and trailing whitespaces in FromString' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox