[tarantool-patches] Re: [PATCH v2 7/7] sql: store regular identifiers in case-normal form

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Thu Mar 7 20:34:20 MSK 2019



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
> 




More information about the Tarantool-patches mailing list