[tarantool-patches] [PATCH] sql: remove unused mask

Roman Khabibov roman.habibov at tarantool.org
Fri Aug 2 15:46:29 MSK 2019


Field mask of "struct Keyword" is always set to one not null
macroses and used only once for checking that it isn't null. So,
the field should be removed.

Closes #4155
---
Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-4155-keywords
Issue: https://github.com/tarantool/tarantool/issues/4155

 extra/mkkeywordhash.c | 412 ++++++++++++++++++++----------------------
 1 file changed, 192 insertions(+), 220 deletions(-)

diff --git a/extra/mkkeywordhash.c b/extra/mkkeywordhash.c
index a6d0f79a4..ddbaa256a 100644
--- a/extra/mkkeywordhash.c
+++ b/extra/mkkeywordhash.c
@@ -36,7 +36,6 @@ typedef struct Keyword Keyword;
 struct Keyword {
   char *zName;         /* The keyword name */
   char *zTokenType;    /* Token value for this keyword */
-  int mask;            /* Code this keyword if non-zero */
   bool isReserved;     /* Is this word reserved by SQL standard */
   int id;              /* Unique ID for this record */
   int hash;            /* Hash on the keyword */
@@ -50,223 +49,206 @@ struct Keyword {
   char zOrigName[50];  /* Original keyword name before processing */
 };
 
-/*
-** Define masks used to determine which keywords are allowed
-*/
-#define ALTER        0x00000001
-#define ALWAYS       0x00000002
-#  define AUTOINCR   0x00000010
-#  define CAST       0x00000020
-#  define COMPOUND   0x00000040
-#  define CONFLICT   0x00000080
-#define EXPLAIN      0x00000100
-#define FKEY         0x00000200
-#  define PRAGMA     0x00000400
-#define SUBQUERY     0x00001000
-#  define TRIGGER    0x00002000
-#  define VIEW       0x00008000
-#  define CTE        0x00040000
-#  define RESERVED   0x00000001
 /*
 ** These are the keywords
 */
 static Keyword aKeywordTable[] = {
-  { "ABORT",                  "TK_ABORT",       CONFLICT|TRIGGER, false },
-  { "ACTION",                 "TK_ACTION",      FKEY,             false },
-  { "ADD",                    "TK_ADD",         ALTER,            false },
-  { "AFTER",                  "TK_AFTER",       TRIGGER,          false },
-  { "ALL",                    "TK_ALL",         ALWAYS,           true  },
-  { "ALTER",                  "TK_ALTER",       ALTER,            true  },
-  { "ANALYZE",                "TK_STANDARD",    RESERVED,         true  },
-  { "AND",                    "TK_AND",         ALWAYS,           true  },
-  { "AS",                     "TK_AS",          ALWAYS,           true  },
-  { "ASC",                    "TK_ASC",         ALWAYS,           true  },
-  { "AUTOINCREMENT",          "TK_AUTOINCR",    AUTOINCR,         false },
-  { "BEFORE",                 "TK_BEFORE",      TRIGGER,          false },
-  { "BEGIN",                  "TK_BEGIN",       TRIGGER,          true  },
-  { "BETWEEN",                "TK_BETWEEN",     ALWAYS,           true  },
-  { "BOOL",                   "TK_BOOLEAN",     ALWAYS,           true  },
-  { "BOOLEAN",                "TK_BOOLEAN",     ALWAYS,           true  },
-  { "BY",                     "TK_BY",          ALWAYS,           true  },
-  { "CASCADE",                "TK_CASCADE",     FKEY,             false },
-  { "CASE",                   "TK_CASE",        ALWAYS,           true  },
-  { "CAST",                   "TK_CAST",        CAST,             false },
-  { "CHECK",                  "TK_CHECK",       ALWAYS,           true  },
-  { "COLLATE",                "TK_COLLATE",     ALWAYS,           true  },
+  { "ABORT",                  "TK_ABORT",       false },
+  { "ACTION",                 "TK_ACTION",      false },
+  { "ADD",                    "TK_ADD",         false },
+  { "AFTER",                  "TK_AFTER",       false },
+  { "ALL",                    "TK_ALL",         true  },
+  { "ALTER",                  "TK_ALTER",       true  },
+  { "ANALYZE",                "TK_STANDARD",    true  },
+  { "AND",                    "TK_AND",         true  },
+  { "AS",                     "TK_AS",          true  },
+  { "ASC",                    "TK_ASC",         true  },
+  { "AUTOINCREMENT",          "TK_AUTOINCR",    false },
+  { "BEFORE",                 "TK_BEFORE",      false },
+  { "BEGIN",                  "TK_BEGIN",       true  },
+  { "BETWEEN",                "TK_BETWEEN",     true  },
+  { "BOOL",                   "TK_BOOLEAN",     true  },
+  { "BOOLEAN",                "TK_BOOLEAN",     true  },
+  { "BY",                     "TK_BY",          true  },
+  { "CASCADE",                "TK_CASCADE",     false },
+  { "CASE",                   "TK_CASE",        true  },
+  { "CAST",                   "TK_CAST",        false },
+  { "CHECK",                  "TK_CHECK",       true  },
+  { "COLLATE",                "TK_COLLATE",     true  },
   /* gh-3075: Reserved until ALTER ADD COLUMN is implemeneted.
    * Move it back to ALTER when done.
    */
   /* { "COLUMN",                 "TK_COLUMNKW",    ALTER,            true  }, */
-  { "COLUMN",                 "TK_STANDARD",    RESERVED,         true  },
-  { "COMMIT",                 "TK_COMMIT",      ALWAYS,           true  },
-  { "CONFLICT",               "TK_CONFLICT",    CONFLICT,         false },
-  { "CONSTRAINT",             "TK_CONSTRAINT",  ALWAYS,           true  },
-  { "CREATE",                 "TK_CREATE",      ALWAYS,           true  },
-  { "CROSS",                  "TK_JOIN_KW",     ALWAYS,           true  },
-  { "DEFAULT",                "TK_DEFAULT",     ALWAYS,           true  },
-  { "DEFERRED",               "TK_DEFERRED",    ALWAYS,           false },
-  { "DEFERRABLE",             "TK_DEFERRABLE",  FKEY,             false },
-  { "DELETE",                 "TK_DELETE",      ALWAYS,           true  },
-  { "DESC",                   "TK_DESC",        ALWAYS,           true  },
-  { "DISTINCT",               "TK_DISTINCT",    ALWAYS,           true  },
-  { "DROP",                   "TK_DROP",        ALWAYS,           true  },
-  { "END",                    "TK_END",         ALWAYS,           true  },
-  { "EACH",                   "TK_EACH",        TRIGGER,          true  },
-  { "ELSE",                   "TK_ELSE",        ALWAYS,           true  },
-  { "ESCAPE",                 "TK_ESCAPE",      ALWAYS,           true  },
-  { "EXCEPT",                 "TK_EXCEPT",      COMPOUND,         true  },
-  { "EXISTS",                 "TK_EXISTS",      ALWAYS,           true  },
-  { "EXPLAIN",                "TK_EXPLAIN",     EXPLAIN,          true  },
-  { "FAIL",                   "TK_FAIL",        CONFLICT|TRIGGER, false },
-  { "FALSE",                  "TK_FALSE",       ALWAYS,           true  },
-  { "FOR",                    "TK_FOR",         TRIGGER,          true  },
-  { "FOREIGN",                "TK_FOREIGN",     FKEY,             true  },
-  { "FROM",                   "TK_FROM",        ALWAYS,           true  },
-  { "FULL",                   "TK_FULL",        ALWAYS,           true  },
-  { "GROUP",                  "TK_GROUP",       ALWAYS,           true  },
-  { "HAVING",                 "TK_HAVING",      ALWAYS,           true  },
-  { "IF",                     "TK_IF",          ALWAYS,           true  },
-  { "IGNORE",                 "TK_IGNORE",      CONFLICT|TRIGGER, false },
-  { "IMMEDIATE",              "TK_IMMEDIATE",   ALWAYS,           true  },
-  { "IN",                     "TK_IN",          ALWAYS,           true  },
-  { "INDEX",                  "TK_INDEX",       ALWAYS,           true  },
-  { "INDEXED",                "TK_INDEXED",     ALWAYS,           false },
-  { "INITIALLY",              "TK_INITIALLY",   FKEY,             false },
-  { "INNER",                  "TK_JOIN_KW",     ALWAYS,           true  },
-  { "INSERT",                 "TK_INSERT",      ALWAYS,           true  },
-  { "INSTEAD",                "TK_INSTEAD",     TRIGGER,          false },
-  { "INTERSECT",              "TK_INTERSECT",   COMPOUND,         true  },
-  { "INTO",                   "TK_INTO",        ALWAYS,           true  },
-  { "IS",                     "TK_IS",          ALWAYS,           true  },
-  { "JOIN",                   "TK_JOIN",        ALWAYS,           true  },
-  { "KEY",                    "TK_KEY",         ALWAYS,           false },
-  { "LEFT",                   "TK_JOIN_KW",     ALWAYS,           true  },
-  { "LIKE",                   "TK_LIKE_KW",     ALWAYS,           true  },
-  { "LIMIT",                  "TK_LIMIT",       ALWAYS,           false },
-  { "MATCH",                  "TK_MATCH",       ALWAYS,           true  },
-  { "NATURAL",                "TK_JOIN_KW",     ALWAYS,           true  },
-  { "NO",                     "TK_NO",          FKEY,             false },
-  { "NOT",                    "TK_NOT",         ALWAYS,           true  },
-  { "NULL",                   "TK_NULL",        ALWAYS,           true  },
-  { "NUMBER",                 "TK_NUMBER",      ALWAYS,           true  },
-  { "OF",                     "TK_OF",          ALWAYS,           true  },
-  { "OFFSET",                 "TK_OFFSET",      ALWAYS,           false },
-  { "ON",                     "TK_ON",          ALWAYS,           true  },
-  { "OR",                     "TK_OR",          ALWAYS,           true  },
-  { "ORDER",                  "TK_ORDER",       ALWAYS,           true  },
-  { "OUTER",                  "TK_JOIN_KW",     ALWAYS,           true  },
-  { "PARTIAL",                "TK_PARTIAL",     ALWAYS,           true  },
-  { "PLAN",                   "TK_PLAN",        EXPLAIN,          false },
-  { "PRAGMA",                 "TK_PRAGMA",      PRAGMA,           true  },
-  { "PRIMARY",                "TK_PRIMARY",     ALWAYS,           true  },
-  { "QUERY",                  "TK_QUERY",       EXPLAIN,          false },
-  { "RAISE",                  "TK_RAISE",       TRIGGER,          false },
-  { "RECURSIVE",              "TK_RECURSIVE",   CTE,              true  },
-  { "REFERENCES",             "TK_REFERENCES",  FKEY,             true  },
-  { "REGEXP",                 "TK_LIKE_KW",     ALWAYS,           false },
-  { "RELEASE",                "TK_RELEASE",     ALWAYS,           true  },
-  { "RENAME",                 "TK_RENAME",      ALTER,            true  },
-  { "REPLACE",                "TK_REPLACE",     CONFLICT,         true  },
-  { "RESTRICT",               "TK_RESTRICT",    FKEY,             false },
-  { "RIGHT",                  "TK_JOIN_KW",     ALWAYS,           true  },
-  { "ROLLBACK",               "TK_ROLLBACK",    ALWAYS,           true  },
-  { "ROW",                    "TK_ROW",         TRIGGER,          true  },
-  { "SAVEPOINT",              "TK_SAVEPOINT",   ALWAYS,           true  },
-  { "SCALAR",                 "TK_SCALAR",      ALWAYS,           true  },
-  { "SELECT",                 "TK_SELECT",      ALWAYS,           true  },
-  { "SET",                    "TK_SET",         ALWAYS,           true  },
-  { "SIMPLE",                 "TK_SIMPLE",      ALWAYS,           true  },
-  { "START",                  "TK_START",       ALWAYS,           true  },
-  { "STRING",                 "TK_STRING_KW",   ALWAYS,           true  },
-  { "TABLE",                  "TK_TABLE",       ALWAYS,           true  },
-  { "THEN",                   "TK_THEN",        ALWAYS,           true  },
-  { "TO",                     "TK_TO",          ALWAYS,           true  },
-  { "TRANSACTION",            "TK_TRANSACTION", ALWAYS,           true  },
-  { "TRIGGER",                "TK_TRIGGER",     TRIGGER,          true  },
-  { "TRUE",                   "TK_TRUE",        ALWAYS,           true  },
-  { "UNION",                  "TK_UNION",       COMPOUND,         true  },
-  { "UNIQUE",                 "TK_UNIQUE",      ALWAYS,           true  },
-  { "UNKNOWN",                "TK_NULL",        ALWAYS,           true  },
-  { "UNSIGNED",               "TK_UNSIGNED",    ALWAYS,           true  },
-  { "UPDATE",                 "TK_UPDATE",      ALWAYS,           true  },
-  { "USING",                  "TK_USING",       ALWAYS,           true  },
-  { "VALUES",                 "TK_VALUES",      ALWAYS,           true  },
-  { "VARBINARY",              "TK_VARBINARY",   ALWAYS,           true  },
-  { "VIEW",                   "TK_VIEW",        VIEW,             true  },
-  { "WITH",                   "TK_WITH",        CTE,              true  },
-  { "WHEN",                   "TK_WHEN",        ALWAYS,           true  },
-  { "WHERE",                  "TK_WHERE",       ALWAYS,           true  },
-  { "ANY",                    "TK_STANDARD",    RESERVED,         true  },
-  { "ASENSITIVE",             "TK_STANDARD",    RESERVED,         true  },
-  { "BLOB",                   "TK_STANDARD",    RESERVED,         true  },
-  { "BINARY",                 "TK_ID",          RESERVED,         true  },
-  { "CALL",                   "TK_STANDARD",    RESERVED,         true  },
-  { "CHAR",                   "TK_CHAR",        RESERVED,         true  },
-  { "CHARACTER",              "TK_ID",          RESERVED,         true  },
-  { "CONDITION",              "TK_STANDARD",    RESERVED,         true  },
-  { "CONNECT",                "TK_STANDARD",    RESERVED,         true  },
-  { "CURRENT",                "TK_STANDARD",    RESERVED,         true  },
-  { "CURRENT_USER",           "TK_STANDARD",    RESERVED,         true  },
-  { "CURSOR",                 "TK_STANDARD",    RESERVED,         true  },
-  { "CURRENT_DATE",           "TK_STANDARD",    RESERVED,         true  },
-  { "CURRENT_TIME",           "TK_STANDARD",    RESERVED,         true  },
-  { "CURRENT_TIMESTAMP",      "TK_STANDARD",    RESERVED,         true  },
-  { "DATE",                   "TK_STANDARD",    RESERVED,         true  },
-  { "DATETIME",               "TK_STANDARD",    RESERVED,         true  },
-  { "DECIMAL",                "TK_STANDARD",    RESERVED,         true  },
-  { "DECLARE",                "TK_STANDARD",    RESERVED,         true  },
-  { "DENSE_RANK",             "TK_STANDARD",    RESERVED,         true  },
-  { "DESCRIBE",               "TK_STANDARD",    RESERVED,         true  },
-  { "DETERMINISTIC",          "TK_STANDARD",    RESERVED,         true  },
-  { "DOUBLE",                 "TK_STANDARD",    RESERVED,         true  },
-  { "ELSEIF",                 "TK_STANDARD",    RESERVED,         true  },
-  { "FETCH",                  "TK_STANDARD",    RESERVED,         true  },
-  { "FLOAT",                  "TK_STANDARD",    RESERVED,         true  },
-  { "FUNCTION",               "TK_STANDARD",    RESERVED,         true  },
-  { "GET",                    "TK_STANDARD",    RESERVED,         true  },
-  { "GRANT",                  "TK_STANDARD",    RESERVED,         true  },
-  { "INT",                    "TK_INT",         RESERVED,         true  },
-  { "INTEGER",                "TK_INTEGER_KW",  RESERVED,         true  },
-  { "INOUT",                  "TK_STANDARD",    RESERVED,         true  },
-  { "INSENSITIVE",            "TK_STANDARD",    RESERVED,         true  },
-  { "ITERATE",                "TK_STANDARD",    RESERVED,         true  },
-  { "LEAVE",                  "TK_STANDARD",    RESERVED,         true  },
-  { "LOCALTIME",              "TK_STANDARD",    RESERVED,         true  },
-  { "LOCALTIMESTAMP",         "TK_STANDARD",    RESERVED,         true  },
-  { "LOOP",                   "TK_STANDARD",    RESERVED,         true  },
-  { "NUM",                    "TK_STANDARD",    RESERVED,         true  },
-  { "NUMERIC",                "TK_STANDARD",    RESERVED,         true  },
-  { "OUT",                    "TK_STANDARD",    RESERVED,         true  },
-  { "OVER",                   "TK_STANDARD",    RESERVED,         true  },
-  { "PARTITION",              "TK_STANDARD",    RESERVED,         true  },
-  { "PRECISION",              "TK_STANDARD",    RESERVED,         true  },
-  { "PROCEDURE",              "TK_STANDARD",    RESERVED,         true  },
-  { "RANGE",                  "TK_STANDARD",    RESERVED,         true  },
-  { "RANK",                   "TK_STANDARD",    RESERVED,         true  },
-  { "READS",                  "TK_STANDARD",    RESERVED,         true  },
-  { "REAL",                   "TK_STANDARD",    RESERVED,         true  },
-  { "REPEAT",                 "TK_STANDARD",    RESERVED,         true  },
-  { "RESIGNAL",               "TK_STANDARD",    RESERVED,         true  },
-  { "RETURN",                 "TK_STANDARD",    RESERVED,         true  },
-  { "REVOKE",                 "TK_STANDARD",    RESERVED,         true  },
-  { "ROWS",                   "TK_STANDARD",    RESERVED,         true  },
-  { "ROW_NUMBER",             "TK_STANDARD",    RESERVED,         true  },
-  { "SENSITIVE",              "TK_STANDARD",    RESERVED,         true  },
-  { "SIGNAL",                 "TK_STANDARD",    RESERVED,         true  },
-  { "SMALLINT",               "TK_ID",          RESERVED,         true  },
-  { "SPECIFIC",               "TK_STANDARD",    RESERVED,         true  },
-  { "SYSTEM",                 "TK_STANDARD",    RESERVED,         true  },
-  { "SQL",                    "TK_STANDARD",    RESERVED,         true  },
-  { "USER",                   "TK_STANDARD",    RESERVED,         true  },
-  { "VARCHAR",                "TK_VARCHAR",     RESERVED,         true  },
-  { "WHENEVER",               "TK_STANDARD",    RESERVED,         true  },
-  { "WHILE",                  "TK_STANDARD",    RESERVED,         true  },
-  { "TEXT",                   "TK_TEXT",        RESERVED,         true  },
-  { "TRUNCATE",               "TK_TRUNCATE",    ALWAYS,           true  },
-  { "TRIM",                   "TK_TRIM",        ALWAYS,           true  },
-  { "LEADING",                "TK_LEADING",     ALWAYS,           true  },
-  { "TRAILING",               "TK_TRAILING",    ALWAYS,           true  },
-  { "BOTH",                   "TK_BOTH",        ALWAYS,           true  },
+  { "COLUMN",                 "TK_STANDARD",    true  },
+  { "COMMIT",                 "TK_COMMIT",      true  },
+  { "CONFLICT",               "TK_CONFLICT",    false },
+  { "CONSTRAINT",             "TK_CONSTRAINT",  true  },
+  { "CREATE",                 "TK_CREATE",      true  },
+  { "CROSS",                  "TK_JOIN_KW",     true  },
+  { "DEFAULT",                "TK_DEFAULT",     true  },
+  { "DEFERRED",               "TK_DEFERRED",    false },
+  { "DEFERRABLE",             "TK_DEFERRABLE",  false },
+  { "DELETE",                 "TK_DELETE",      true  },
+  { "DESC",                   "TK_DESC",        true  },
+  { "DISTINCT",               "TK_DISTINCT",    true  },
+  { "DROP",                   "TK_DROP",        true  },
+  { "END",                    "TK_END",         true  },
+  { "EACH",                   "TK_EACH",        true  },
+  { "ELSE",                   "TK_ELSE",        true  },
+  { "ESCAPE",                 "TK_ESCAPE",      true  },
+  { "EXCEPT",                 "TK_EXCEPT",      true  },
+  { "EXISTS",                 "TK_EXISTS",      true  },
+  { "EXPLAIN",                "TK_EXPLAIN",     true  },
+  { "FAIL",                   "TK_FAIL",        false },
+  { "FALSE",                  "TK_FALSE",       true  },
+  { "FOR",                    "TK_FOR",         true  },
+  { "FOREIGN",                "TK_FOREIGN",     true  },
+  { "FROM",                   "TK_FROM",        true  },
+  { "FULL",                   "TK_FULL",        true  },
+  { "GROUP",                  "TK_GROUP",       true  },
+  { "HAVING",                 "TK_HAVING",      true  },
+  { "IF",                     "TK_IF",          true  },
+  { "IGNORE",                 "TK_IGNORE",      false },
+  { "IMMEDIATE",              "TK_IMMEDIATE",   true  },
+  { "IN",                     "TK_IN",          true  },
+  { "INDEX",                  "TK_INDEX",       true  },
+  { "INDEXED",                "TK_INDEXED",     false },
+  { "INITIALLY",              "TK_INITIALLY",   false },
+  { "INNER",                  "TK_JOIN_KW",     true  },
+  { "INSERT",                 "TK_INSERT",      true  },
+  { "INSTEAD",                "TK_INSTEAD",     false },
+  { "INTERSECT",              "TK_INTERSECT",   true  },
+  { "INTO",                   "TK_INTO",        true  },
+  { "IS",                     "TK_IS",          true  },
+  { "JOIN",                   "TK_JOIN",        true  },
+  { "KEY",                    "TK_KEY",         false },
+  { "LEFT",                   "TK_JOIN_KW",     true  },
+  { "LIKE",                   "TK_LIKE_KW",     true  },
+  { "LIMIT",                  "TK_LIMIT",       false },
+  { "MATCH",                  "TK_MATCH",       true  },
+  { "NATURAL",                "TK_JOIN_KW",     true  },
+  { "NO",                     "TK_NO",          false },
+  { "NOT",                    "TK_NOT",         true  },
+  { "NULL",                   "TK_NULL",        true  },
+  { "NUMBER",                 "TK_NUMBER",      true  },
+  { "OF",                     "TK_OF",          true  },
+  { "OFFSET",                 "TK_OFFSET",      false },
+  { "ON",                     "TK_ON",          true  },
+  { "OR",                     "TK_OR",          true  },
+  { "ORDER",                  "TK_ORDER",       true  },
+  { "OUTER",                  "TK_JOIN_KW",     true  },
+  { "PARTIAL",                "TK_PARTIAL",     true  },
+  { "PLAN",                   "TK_PLAN",        false },
+  { "PRAGMA",                 "TK_PRAGMA",      true  },
+  { "PRIMARY",                "TK_PRIMARY",     true  },
+  { "QUERY",                  "TK_QUERY",       false },
+  { "RAISE",                  "TK_RAISE",       false },
+  { "RECURSIVE",              "TK_RECURSIVE",   true  },
+  { "REFERENCES",             "TK_REFERENCES",  true  },
+  { "REGEXP",                 "TK_LIKE_KW",     false },
+  { "RELEASE",                "TK_RELEASE",     true  },
+  { "RENAME",                 "TK_RENAME",      true  },
+  { "REPLACE",                "TK_REPLACE",     true  },
+  { "RESTRICT",               "TK_RESTRICT",    false },
+  { "RIGHT",                  "TK_JOIN_KW",     true  },
+  { "ROLLBACK",               "TK_ROLLBACK",    true  },
+  { "ROW",                    "TK_ROW",         true  },
+  { "SAVEPOINT",              "TK_SAVEPOINT",   true  },
+  { "SCALAR",                 "TK_SCALAR",      true  },
+  { "SELECT",                 "TK_SELECT",      true  },
+  { "SET",                    "TK_SET",         true  },
+  { "SIMPLE",                 "TK_SIMPLE",      true  },
+  { "START",                  "TK_START",       true  },
+  { "STRING",                 "TK_STRING_KW",   true  },
+  { "TABLE",                  "TK_TABLE",       true  },
+  { "THEN",                   "TK_THEN",        true  },
+  { "TO",                     "TK_TO",          true  },
+  { "TRANSACTION",            "TK_TRANSACTION", true  },
+  { "TRIGGER",                "TK_TRIGGER",     true  },
+  { "TRUE",                   "TK_TRUE",        true  },
+  { "UNION",                  "TK_UNION",       true  },
+  { "UNIQUE",                 "TK_UNIQUE",      true  },
+  { "UNKNOWN",                "TK_NULL",        true  },
+  { "UNSIGNED",               "TK_UNSIGNED",    true  },
+  { "UPDATE",                 "TK_UPDATE",      true  },
+  { "USING",                  "TK_USING",       true  },
+  { "VALUES",                 "TK_VALUES",      true  },
+  { "VARBINARY",              "TK_VARBINARY",   true  },
+  { "VIEW",                   "TK_VIEW",        true  },
+  { "WITH",                   "TK_WITH",        true  },
+  { "WHEN",                   "TK_WHEN",        true  },
+  { "WHERE",                  "TK_WHERE",       true  },
+  { "ANY",                    "TK_STANDARD",    true  },
+  { "ASENSITIVE",             "TK_STANDARD",    true  },
+  { "BLOB",                   "TK_STANDARD",    true  },
+  { "BINARY",                 "TK_ID",          true  },
+  { "CALL",                   "TK_STANDARD",    true  },
+  { "CHAR",                   "TK_CHAR",        true  },
+  { "CHARACTER",              "TK_ID",          true  },
+  { "CONDITION",              "TK_STANDARD",    true  },
+  { "CONNECT",                "TK_STANDARD",    true  },
+  { "CURRENT",                "TK_STANDARD",    true  },
+  { "CURRENT_USER",           "TK_STANDARD",    true  },
+  { "CURSOR",                 "TK_STANDARD",    true  },
+  { "CURRENT_DATE",           "TK_STANDARD",    true  },
+  { "CURRENT_TIME",           "TK_STANDARD",    true  },
+  { "CURRENT_TIMESTAMP",      "TK_STANDARD",    true  },
+  { "DATE",                   "TK_STANDARD",    true  },
+  { "DATETIME",               "TK_STANDARD",    true  },
+  { "DECIMAL",                "TK_STANDARD",    true  },
+  { "DECLARE",                "TK_STANDARD",    true  },
+  { "DENSE_RANK",             "TK_STANDARD",    true  },
+  { "DESCRIBE",               "TK_STANDARD",    true  },
+  { "DETERMINISTIC",          "TK_STANDARD",    true  },
+  { "DOUBLE",                 "TK_STANDARD",    true  },
+  { "ELSEIF",                 "TK_STANDARD",    true  },
+  { "FETCH",                  "TK_STANDARD",    true  },
+  { "FLOAT",                  "TK_STANDARD",    true  },
+  { "FUNCTION",               "TK_STANDARD",    true  },
+  { "GET",                    "TK_STANDARD",    true  },
+  { "GRANT",                  "TK_STANDARD",    true  },
+  { "INT",                    "TK_INT",         true  },
+  { "INTEGER",                "TK_INTEGER_KW",  true  },
+  { "INOUT",                  "TK_STANDARD",    true  },
+  { "INSENSITIVE",            "TK_STANDARD",    true  },
+  { "ITERATE",                "TK_STANDARD",    true  },
+  { "LEAVE",                  "TK_STANDARD",    true  },
+  { "LOCALTIME",              "TK_STANDARD",    true  },
+  { "LOCALTIMESTAMP",         "TK_STANDARD",    true  },
+  { "LOOP",                   "TK_STANDARD",    true  },
+  { "NUM",                    "TK_STANDARD",    true  },
+  { "NUMERIC",                "TK_STANDARD",    true  },
+  { "OUT",                    "TK_STANDARD",    true  },
+  { "OVER",                   "TK_STANDARD",    true  },
+  { "PARTITION",              "TK_STANDARD",    true  },
+  { "PRECISION",              "TK_STANDARD",    true  },
+  { "PROCEDURE",              "TK_STANDARD",    true  },
+  { "RANGE",                  "TK_STANDARD",    true  },
+  { "RANK",                   "TK_STANDARD",    true  },
+  { "READS",                  "TK_STANDARD",    true  },
+  { "REAL",                   "TK_STANDARD",    true  },
+  { "REPEAT",                 "TK_STANDARD",    true  },
+  { "RESIGNAL",               "TK_STANDARD",    true  },
+  { "RETURN",                 "TK_STANDARD",    true  },
+  { "REVOKE",                 "TK_STANDARD",    true  },
+  { "ROWS",                   "TK_STANDARD",    true  },
+  { "ROW_NUMBER",             "TK_STANDARD",    true  },
+  { "SENSITIVE",              "TK_STANDARD",    true  },
+  { "SIGNAL",                 "TK_STANDARD",    true  },
+  { "SMALLINT",               "TK_ID",          true  },
+  { "SPECIFIC",               "TK_STANDARD",    true  },
+  { "SYSTEM",                 "TK_STANDARD",    true  },
+  { "SQL",                    "TK_STANDARD",    true  },
+  { "USER",                   "TK_STANDARD",    true  },
+  { "VARCHAR",                "TK_VARCHAR",     true  },
+  { "WHENEVER",               "TK_STANDARD",    true  },
+  { "WHILE",                  "TK_STANDARD",    true  },
+  { "TEXT",                   "TK_TEXT",        true  },
+  { "TRUNCATE",               "TK_TRUNCATE",    true  },
+  { "TRIM",                   "TK_TRIM",        true  },
+  { "LEADING",                "TK_LEADING",     true  },
+  { "TRAILING",               "TK_TRAILING",    true  },
+  { "BOTH",                   "TK_BOTH",        true  },
 };
 
 /* Number of keywords */
@@ -334,16 +316,6 @@ int main(int argc, char **argv){
   int aHash[1000];  /* 1000 is much bigger than nKeyword */
   char zText[2000];
 
-  /* Remove entries from the list of keywords that have mask==0 */
-  for(i=j=0; i<nKeyword; i++){
-    if( aKeywordTable[i].mask==0 ) continue;
-    if( j<i ){
-      aKeywordTable[j] = aKeywordTable[i];
-    }
-    j++;
-  }
-  nKeyword = j;
-
   /* Fill in the lengths of strings and hashes for all entries. */
   for(i=0; i<nKeyword; i++){
     Keyword *p = &aKeywordTable[i];
-- 
2.20.1 (Apple Git-117)





More information about the Tarantool-patches mailing list