Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: Kirill Shcherbatov <kshcherbatov@tarantool.org>,
	tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v2 7/7] sql: store regular identifiers in case-normal form
Date: Thu, 7 Mar 2019 20:34:20 +0300	[thread overview]
Message-ID: <6f979039-61fc-1ee7-e006-859e85195b33@tarantool.org> (raw)
In-Reply-To: <c5f616783f4c401b89c272d139f35fda218a6af3.1551265819.git.kshcherbatov@tarantool.org>



On 27/02/2019 14:13, Kirill Shcherbatov wrote:
> Introduced a new sql_normalize_name routine performing SQL name
> conversion to case-normal form via unicode character folding.
> For example, ß is converted to SS. The result is similar to SQL
> UPPER function.
> 
> Closes #3931

First of all, I do not see a test on failed normalization.
Please, add.

See 2 comments below.

> ---
>   src/box/lua/lua_sql.c                 | 11 +++--
>   src/box/sql/build.c                   | 36 +++++++++-----
>   src/box/sql/expr.c                    | 71 ++++++++++++++++++---------
>   src/box/sql/parse.y                   | 26 ++++++++--
>   src/box/sql/select.c                  | 20 ++++++--
>   src/box/sql/sqlInt.h                  | 26 +++++++++-
>   src/box/sql/trigger.c                 | 18 +++++--
>   src/box/sql/util.c                    | 42 ++++++++++------
>   test/sql-tap/identifier_case.test.lua | 12 +++--
>   9 files changed, 188 insertions(+), 74 deletions(-)
> 
> diff --git a/src/box/sql/build.c b/src/box/sql/build.c
> index 24f20836b..d167a5714 100644
> --- a/src/box/sql/build.c
> +++ b/src/box/sql/build.c
> @@ -472,6 +478,10 @@ sqlAddColumn(Parse * pParse, Token * pName, struct type_def *type_def)
>   	column_def->type = type_def->type;
>   	def->field_count++;
>   	pParse->constraintName.n = 0;
> +	return;
> +tarantool_error:
> +	pParse->rc = SQL_TARANTOOL_ERROR;
> +	pParse->nErr++;

1. You have sql_parser_error, and you used it already in
some other places. Fix it, please, in all touched places.

>   }
>   
>   void
> diff --git a/test/sql-tap/identifier_case.test.lua b/test/sql-tap/identifier_case.test.lua
> index 923d5e66a..aaa4cc85a 100755
> --- a/test/sql-tap/identifier_case.test.lua
> +++ b/test/sql-tap/identifier_case.test.lua
> @@ -66,7 +68,7 @@ test:do_test(
>       function ()
>           return test:drop_all_tables()
>       end,
> -    3)
> +    4)

2. Why?

>   
>   data = {
>       { 1,  [[ columnn ]], {0} },
> -- 
> 2.20.1
> 

  reply	other threads:[~2019-03-07 17:34 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-27 11:13 [tarantool-patches] [PATCH v2 0/7] " Kirill Shcherbatov
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 1/7] sql: refactor sql_alloc_src_list to set diag Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 2/7] sql: rework sql_src_list_enlarge " Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 3/7] sql: refactor sql_src_list_append " Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-03-18 19:33       ` Vladislav Shpilevoy
2019-03-20 11:02         ` Kirill Shcherbatov
2019-03-26 17:08           ` Vladislav Shpilevoy
2019-03-26 18:07             ` Vladislav Shpilevoy
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 4/7] sql: refactor sql_name_from_token " Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-03-18 19:33       ` Vladislav Shpilevoy
2019-03-20 11:02         ` Kirill Shcherbatov
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 5/7] sql: refactor sql_trigger_step_allocate " Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-03-18 19:33       ` Vladislav Shpilevoy
2019-03-20 11:02         ` Kirill Shcherbatov
2019-03-26 17:08           ` Vladislav Shpilevoy
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 6/7] sql: refactor sql_expr_create " Kirill Shcherbatov
2019-03-07 17:34   ` [tarantool-patches] " Vladislav Shpilevoy
2019-03-11 15:04     ` Kirill Shcherbatov
2019-03-18 19:33       ` Vladislav Shpilevoy
2019-03-20 11:02         ` Kirill Shcherbatov
2019-03-26 17:08           ` Vladislav Shpilevoy
2019-02-27 11:13 ` [tarantool-patches] [PATCH v2 7/7] sql: store regular identifiers in case-normal form Kirill Shcherbatov
2019-03-07 17:34   ` Vladislav Shpilevoy [this message]
2019-03-11 15:04     ` [tarantool-patches] " Kirill Shcherbatov
2019-03-18 19:33       ` Vladislav Shpilevoy
2019-03-20 11:02         ` Kirill Shcherbatov
2019-03-26 17:08           ` Vladislav Shpilevoy
2019-03-18 19:33 ` [tarantool-patches] Re: [PATCH v2 0/7] " Vladislav Shpilevoy
2019-03-20 11:02   ` Kirill Shcherbatov
2019-03-26 17:09     ` Vladislav Shpilevoy
2019-03-27 14:06 ` Kirill Yukhin

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=6f979039-61fc-1ee7-e006-859e85195b33@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=kshcherbatov@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v2 7/7] sql: store regular identifiers in case-normal form' \
    /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