* [tarantool-patches] [PATCH] sql: remove ENGINE from list of reserved keywords
@ 2019-09-10 20:20 Nikita Pettik
0 siblings, 0 replies; only message in thread
From: Nikita Pettik @ 2019-09-10 20:20 UTC (permalink / raw)
To: tarantool-patches; +Cc: kyukhin, 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
| 2 +-
src/box/sql/parse.y | 2 +-
test/sql-tap/keyword1.test.lua | 3 ++-
3 files changed, 4 insertions(+), 3 deletions(-)
--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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-09-10 20:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10 20:20 [tarantool-patches] [PATCH] sql: remove ENGINE from list of reserved keywords Nikita Pettik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox