diff --git a/mysql-test/r/information_schema_keywords.result b/mysql-test/r/information_schema_keywords.result index 078f883a913..860f1f35d9a 100644 --- a/mysql-test/r/information_schema_keywords.result +++ b/mysql-test/r/information_schema_keywords.result @@ -104,7 +104,7 @@ CONVERT 1 CPU 0 CREATE 1 CROSS 1 -CUBE 0 +CUBE 1 CUME_DIST 1 CURRENT 0 CURRENT_DATE 1 @@ -331,7 +331,7 @@ LONGBLOB 1 LONGTEXT 1 LOOP 1 LOW_PRIORITY 1 -MANUAL 0 +MANUAL 1 MASTER 0 MATCH 1 MAXVALUE 1 @@ -419,7 +419,7 @@ OVER 1 OWNER 0 PACK_KEYS 0 PAGE 0 -PARALLEL 0 +PARALLEL 1 PARSER 0 PARSE_TREE 0 PARTIAL 0 @@ -455,7 +455,7 @@ PROFILE 0 PROFILES 0 PROXY 0 PURGE 1 -QUALIFY 0 +QUALIFY 1 QUARTER 0 QUERY 0 QUICK 0 @@ -647,7 +647,7 @@ SWITCHES 0 SYSTEM 1 TABLE 1 TABLES 0 -TABLESAMPLE 0 +TABLESAMPLE 1 TABLESPACE 0 TABLE_CHECKSUM 0 TABLE_NAME 0 diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index e70bb2216f9..ee26fa9cfe1 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -618,6 +618,22 @@ void warn_on_deprecated_user_defined_collation( /* Tokens from MySQL 5.7, keep in alphabetical order. + + Keyword reservation convention + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Non-reserved: %token NAME num + The keyword may be used as an unquoted identifier. + It MUST appear in one of the ident_keywords_* rules below. + + Reserved: %token NAME num + The keyword may NOT be used as an unquoted identifier. + It MUST NOT appear in any ident_keywords_* rule below. + + WARNING: Declaring a reserved keyword with %token + (i.e. omitting it from ident_keywords_* while using the non-reserved + form) is a silent error. The parser still rejects the word as an + identifier, but INFORMATION_SCHEMA.KEYWORDS will incorrectly report + RESERVED=0. See sql/gen_keyword_list.cc for how the flag is derived. */ %token ABORT_SYM 258 /* INTERNAL (used in lex) */ @@ -718,7 +734,7 @@ void warn_on_deprecated_user_defined_collation( %token CPU_SYM 353 %token CREATE 354 /* SQL-2003-R */ %token CROSS 355 /* SQL-2003-R */ -%token CUBE_SYM 356 /* SQL-2003-R */ +%token CUBE_SYM 356 /* SQL-2003-R */ %token CURDATE 357 /* MYSQL-FUNC */ %token CURRENT_SYM 358 /* SQL-2003-R */ %token CURRENT_USER 359 /* SQL-2003-R */ @@ -1446,14 +1462,14 @@ void warn_on_deprecated_user_defined_collation( %token LOG_SYM 1206 /* MYSQL */ %token GTIDS_SYM 1207 /* MYSQL */ -%token PARALLEL_SYM 1208 /* MYSQL */ +%token PARALLEL_SYM 1208 /* MYSQL */ %token S3_SYM 1209 /* MYSQL */ -%token QUALIFY_SYM 1210 /* MYSQL */ +%token QUALIFY_SYM 1210 /* MYSQL */ %token AUTO_SYM 1211 /* MYSQL */ -%token MANUAL_SYM 1212 /* MYSQL */ +%token MANUAL_SYM 1212 /* MYSQL */ %token BERNOULLI_SYM 1213 /* SQL-2016-N */ -%token TABLESAMPLE_SYM 1214 /* SQL-2016-R */ +%token TABLESAMPLE_SYM 1214 /* SQL-2016-R */ /* NOTE! When adding new non-standard keywords, make sure they are added to the