From: imeevma@tarantool.org To: korablev@tarantool.org Cc: tarantool-patches@freelists.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 [thread overview] Message-ID: <7fe149e8a99b257503e64c618a6bf382a2188f5a.1551114402.git.imeevma@gmail.com> (raw) In-Reply-To: <cover.1551114402.git.imeevma@gmail.com> 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; ]], { -- <view-3.3.4> - 1, [[syntax error after column name "y"]] + 1, [[keyword "DESC" is reserved]] -- </view-3.3.4> }) -- 2.7.4
next prev parent reply other threads:[~2019-02-25 17:14 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-02-25 17:14 [tarantool-patches] [PATCH v2 0/5] sql: use diag_set() for errors in SQL imeevma 2019-02-25 17:14 ` imeevma [this message] 2019-02-25 19:34 ` [tarantool-patches] Re: [PATCH v2 1/5] sql: remove "syntax error after column name" error n.pettik 2019-02-27 11:32 ` Kirill Yukhin 2019-02-25 17:14 ` [tarantool-patches] [PATCH v2 2/5] sql: rework syntax errors imeevma 2019-02-25 20:02 ` [tarantool-patches] " n.pettik 2019-02-26 8:24 ` Konstantin Osipov 2019-02-26 12:59 ` n.pettik 2019-02-26 13:12 ` Konstantin Osipov 2019-02-26 15:59 ` Imeev Mergen 2019-02-25 17:14 ` [tarantool-patches] [PATCH v2 3/5] sql: save SQL parser errors in diag_set() imeevma 2019-02-25 23:01 ` [tarantool-patches] " n.pettik 2019-02-26 8:25 ` Konstantin Osipov 2019-02-26 15:29 ` Imeev Mergen 2019-02-25 17:14 ` [tarantool-patches] [PATCH v2 4/5] sql: remove file zErrMsg of struct Parse imeevma 2019-02-26 14:47 ` [tarantool-patches] " n.pettik 2019-02-26 15:36 ` Imeev Mergen 2019-02-26 18:17 ` n.pettik 2019-02-25 17:14 ` [tarantool-patches] [PATCH v2 5/5] sql: remove field nErr " imeevma 2019-02-26 8:27 ` [tarantool-patches] " Konstantin Osipov 2019-02-26 14:48 ` n.pettik
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=7fe149e8a99b257503e64c618a6bf382a2188f5a.1551114402.git.imeevma@gmail.com \ --to=imeevma@tarantool.org \ --cc=korablev@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='Re: [tarantool-patches] [PATCH v2 1/5] sql: remove "syntax error after column name" error' \ /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