From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 565F929335 for ; Thu, 7 Mar 2019 12:34:22 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6xXqKxFe2cj9 for ; Thu, 7 Mar 2019 12:34:22 -0500 (EST) Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 139E628BEA for ; Thu, 7 Mar 2019 12:34:22 -0500 (EST) Subject: [tarantool-patches] Re: [PATCH v2 7/7] sql: store regular identifiers in case-normal form References: From: Vladislav Shpilevoy Message-ID: <6f979039-61fc-1ee7-e006-859e85195b33@tarantool.org> Date: Thu, 7 Mar 2019 20:34:20 +0300 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Kirill Shcherbatov , tarantool-patches@freelists.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 >