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 B9070276EB for ; Mon, 25 Feb 2019 12:14:24 -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 R-8ouIzUNRTx for ; Mon, 25 Feb 2019 12:14:24 -0500 (EST) Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 EAFA5276DB for ; Mon, 25 Feb 2019 12:14:23 -0500 (EST) From: imeevma@tarantool.org Subject: [tarantool-patches] [PATCH v2 1/5] sql: remove "syntax error after column name" error Date: Mon, 25 Feb 2019 20:14:21 +0300 Message-Id: <7fe149e8a99b257503e64c618a6bf382a2188f5a.1551114402.git.imeevma@gmail.com> In-Reply-To: References: 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: korablev@tarantool.org Cc: tarantool-patches@freelists.org Error "syntax error after column name" does not make any sense. Let's remove it. Part of #3965 --- src/box/sql/parse.y | 22 +++++----------------- test/sql-tap/view.test.lua | 2 +- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y index 32db685..a5ac220 100644 --- a/src/box/sql/parse.y +++ b/src/box/sql/parse.y @@ -1247,17 +1247,9 @@ uniqueflag(A) ::= . {A = SQL_INDEX_TYPE_NON_UNIQUE;} static ExprList *parserAddExprIdListTerm( Parse *pParse, ExprList *pPrior, - Token *pIdToken, - int hasCollate, - int sortOrder + Token *pIdToken ){ ExprList *p = sql_expr_list_append(pParse->db, pPrior, NULL); - if( (hasCollate || sortOrder != SORT_ORDER_UNDEF) - && pParse->db->init.busy==0 - ){ - sqlErrorMsg(pParse, "syntax error after column name \"%.*s\"", - pIdToken->n, pIdToken->z); - } sqlExprListSetName(pParse, p, pIdToken, 1); return p; } @@ -1265,17 +1257,13 @@ uniqueflag(A) ::= . {A = SQL_INDEX_TYPE_NON_UNIQUE;} eidlist_opt(A) ::= . {A = 0;} eidlist_opt(A) ::= LP eidlist(X) RP. {A = X;} -eidlist(A) ::= eidlist(A) COMMA nm(Y) collate(C) sortorder(Z). { - A = parserAddExprIdListTerm(pParse, A, &Y, C, Z); +eidlist(A) ::= eidlist(A) COMMA nm(Y). { + A = parserAddExprIdListTerm(pParse, A, &Y); } -eidlist(A) ::= nm(Y) collate(C) sortorder(Z). { - A = parserAddExprIdListTerm(pParse, 0, &Y, C, Z); /*A-overwrites-Y*/ +eidlist(A) ::= nm(Y). { + A = parserAddExprIdListTerm(pParse, 0, &Y); /*A-overwrites-Y*/ } -%type collate {int} -collate(C) ::= . {C = 0;} -collate(C) ::= COLLATE id. {C = 1;} - ///////////////////////////// The DROP INDEX command ///////////////////////// // diff --git a/test/sql-tap/view.test.lua b/test/sql-tap/view.test.lua index 49916d6..c99a0a5 100755 --- a/test/sql-tap/view.test.lua +++ b/test/sql-tap/view.test.lua @@ -293,7 +293,7 @@ test:do_catchsql_test( CREATE VIEW v1err(x,y DESC,z) AS SELECT a, b+c, c-b FROM t1; ]], { -- - 1, [[syntax error after column name "y"]] + 1, [[keyword "DESC" is reserved]] -- }) -- 2.7.4