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 129F721236 for ; Tue, 10 Sep 2019 16:20:50 -0400 (EDT) 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 GogcrETfTfF8 for ; Tue, 10 Sep 2019 16:20:50 -0400 (EDT) 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 68DE02122D for ; Tue, 10 Sep 2019 16:20:49 -0400 (EDT) From: Nikita Pettik Subject: [tarantool-patches] [PATCH] sql: remove ENGINE from list of reserved keywords Date: Tue, 10 Sep 2019 23:20:44 +0300 Message-Id: <20190910202044.41532-1-korablev@tarantool.org> 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: tarantool-patches@freelists.org Cc: kyukhin@tarantool.org, Nikita Pettik ENGINE became reserved keyword in 1013a744b. There's no any actual reason why ENGINE should be reserved keyword. What is more, we are going to use this word as a name of some fields for tables forming informational schema. Hence, until it is too late (it is not documented yet), let's remove ENGINE from the list of reserved keywords and allow identifiers be that word. --- Branch: https://github.com/tarantool/tarantool/tree/np/sql-remove-engine-from-keywords extra/mkkeywordhash.c | 2 +- src/box/sql/parse.y | 2 +- test/sql-tap/keyword1.test.lua | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extra/mkkeywordhash.c b/extra/mkkeywordhash.c index bb706ac01..2a59d6a61 100644 --- a/extra/mkkeywordhash.c +++ b/extra/mkkeywordhash.c @@ -93,7 +93,7 @@ static Keyword aKeywordTable[] = { { "DISTINCT", "TK_DISTINCT", true }, { "DROP", "TK_DROP", true }, { "END", "TK_END", true }, - { "ENGINE", "TK_ENGINE", true }, + { "ENGINE", "TK_ENGINE", false }, { "EACH", "TK_EACH", true }, { "ELSE", "TK_ELSE", true }, { "ESCAPE", "TK_ESCAPE", true }, diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y index be3c5c399..643e025bd 100644 --- a/src/box/sql/parse.y +++ b/src/box/sql/parse.y @@ -248,7 +248,7 @@ columnname(A) ::= nm(A) typedef(Y). {sqlAddColumn(pParse,&A,&Y);} // %fallback ID ABORT ACTION ADD AFTER AUTOINCREMENT BEFORE CASCADE - CONFLICT DEFERRED END FAIL + CONFLICT DEFERRED END ENGINE FAIL IGNORE INITIALLY INSTEAD NO MATCH PLAN QUERY KEY OFFSET RAISE RELEASE REPLACE RESTRICT RENAME CTIME_KW IF diff --git a/test/sql-tap/keyword1.test.lua b/test/sql-tap/keyword1.test.lua index 655adaf58..03b1054d2 100755 --- a/test/sql-tap/keyword1.test.lua +++ b/test/sql-tap/keyword1.test.lua @@ -1,6 +1,6 @@ #!/usr/bin/env tarantool test = require("sqltester") -test:plan(178) +test:plan(180) --!./tcltestrunner.lua -- 2009 January 29 @@ -33,6 +33,7 @@ local kwlist = { "before", "conflict", "deferred", + "engine", "fail", "ignore", "initially", -- 2.15.1