From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Nikita Tatunov <hollow653@gmail.com>
Cc: tarantool-patches@freelists.org,
Alex Khatskevich <avkhatskevich@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH] sql: LIKE & GLOB pattern comparison issue
Date: Wed, 18 Jul 2018 20:10:25 +0300 [thread overview]
Message-ID: <20180718171024.ry2cltazdl2hsrpc@tkn_work_nb> (raw)
In-Reply-To: <CAEi+_aq3ibC1=3sN4On=P9rHOEB=mZexKEMo5rf1t=3aa6MBTg@mail.gmail.com>
Two minor comments are below.
WBR, Alexander Turenko.
On Wed, Jul 18, 2018 at 06:57:39PM +0300, Nikita Tatunov wrote:
> ср, 18 июл. 2018 г. в 18:53, Alex Khatskevich
> <[1]avkhatskevich@tarantool.org>:
>
> Once you have fixed comments, please apply a new full diff at the end
> of email, to
> continue review process.
> Answer with a full diff to this email please (just paste as a plain
> text output of `git diff` command)
> On 18.07.2018 18:24, Nikita Tatunov wrote:
>
> -/*
> - * For LIKE and GLOB matching on EBCDIC machines, assume that every
> - * character is exactly one byte in size. Also, provde the Utf8Read()
> - * macro for fast reading of the next character in the common case
> where
> - * the next character is ASCII.
> +/**
> + * Providing there are symbols in string s this macro returns
> + * UTF-8 code of character and pushes pointer to the next symbol
> + * in the string. Otherwise return code is SQL_END_OF_STRING.
Nitpicking: pushes -> promotes?
> */
> -#define Utf8Read(s, e) ucnv_getNextUChar(pUtf8conv, &s, e, &status)
> +#define Utf8Read(s, e) (s < e ?\
> + ucnv_getNextUChar(pUtf8conv, &s, e, &status) : 0)
> +
> +#define SQL_END_OF_STRING 0
Always wrap argument usages of a function-like macro within its body
with parenthesis (consider example I give in the previous email). It is
usual way to handle the fact that a macros works as text replacement,
so, say
#define SUB(x, y) x - y
will give the wrong result for the expression SUB(10, 5 - 3), while
#define SUB(x, y) ((x) - (y))
will produce the correct result.
next prev parent reply other threads:[~2018-07-18 17:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 12:47 [tarantool-patches] " N.Tatunov
2018-06-28 12:54 ` [tarantool-patches] " Hollow111
2018-07-18 2:43 ` Alexander Turenko
2018-07-18 5:51 ` Alex Khatskevich
2018-07-18 15:24 ` Nikita Tatunov
2018-07-18 15:53 ` Alex Khatskevich
2018-07-18 15:57 ` Nikita Tatunov
2018-07-18 17:10 ` Alexander Turenko [this message]
2018-07-19 11:14 ` Nikita Tatunov
2018-07-19 11:56 ` Alex Khatskevich
2018-07-27 11:28 ` Nikita Tatunov
2018-07-27 13:06 ` Alexander Turenko
2018-07-27 19:11 ` Nikita Tatunov
2018-07-27 20:22 ` Alexander Turenko
2018-07-31 13:27 ` Nikita Tatunov
2018-07-31 13:47 ` Alexander Turenko
2018-08-01 10:35 ` Nikita Tatunov
2018-08-01 10:51 ` Nikita Tatunov
2018-08-01 13:56 ` Alex Khatskevich
2018-08-01 18:10 ` Nikita Tatunov
2018-08-01 18:14 ` Nikita Tatunov
2018-08-08 12:38 ` Alex Khatskevich
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=20180718171024.ry2cltazdl2hsrpc@tkn_work_nb \
--to=alexander.turenko@tarantool.org \
--cc=avkhatskevich@tarantool.org \
--cc=hollow653@gmail.com \
--cc=tarantool-patches@freelists.org \
--subject='[tarantool-patches] Re: [PATCH] sql: LIKE & GLOB pattern comparison issue' \
/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