Tarantool development patches archive
 help / color / mirror / Atom feed
From: Nikita Pettik <korablev@tarantool.org>
To: tarantool-patches@freelists.org
Cc: kyukhin@tarantool.org, Nikita Pettik <korablev@tarantool.org>
Subject: [tarantool-patches] [PATCH] sql: remove ENGINE from list of reserved keywords
Date: Tue, 10 Sep 2019 23:20:44 +0300	[thread overview]
Message-ID: <20190910202044.41532-1-korablev@tarantool.org> (raw)

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

                 reply	other threads:[~2019-09-10 20:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20190910202044.41532-1-korablev@tarantool.org \
    --to=korablev@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH] sql: remove ENGINE from list of reserved keywords' \
    /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