Description:
WL#411 introduces an internal PARSE_GCOL_EXPR keyword: we use it to simulate multiple grammars in sql_yacc.yy, especially a sub-grammar to parse generated column expressions from .frm.
The new PARSE_GCOL_EXPR_SYM token behaves as a keyword in the main grammar: we can't use the "PARSE_GCOL_EXPR" name for plain table/column names, user variable/function/procedure etc. names. Such a new limitation is not necessary and unwanted.
How to repeat:
mysql> CREATE TABLE parse_gcol_expr (i INT);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'parse_gcol_expr' at line 1
Suggested fix:
Add the PARSE_GCOL_EXPR_SYM token to the "keyword" grammar rule's right hand side list:
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 0fd4313..5604da6 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -13173,6 +13173,7 @@ keyword:
| OPTIONS_SYM {}
| OWNER_SYM {}
| PARSER_SYM {}
+ | PARSE_GCOL_EXPR_SYM {}
| PORT_SYM {}
| PRECEDES_SYM {}
| PREPARE_SYM {}
mysql> CREATE TABLE parse_gcol_expr (i INT);
Query OK, 0 rows affected (0,31 sec)
Note: it would be nice to insert that new token into the "keyword_sp" rule instead of "keyword", however we can't -- it will introduce a lot of new grammar conflicts, since PARSE_GCOL_EXPR_SYM is the 1st token of the pseudo-statement.
Thus, after the fix we'll can use the PARSE_GCOL_EXPR string for table/column/variable/function etc names, but still can't use it for SP/SF labels.