summaryrefslogtreecommitdiff
path: root/sql/sql_yacc_ora.yy
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-05-18 06:47:54 +0400
committerAlexander Barkov <bar@mariadb.com>2018-05-18 06:47:54 +0400
commitfdcc95143de96ce12b5c0c84e07f4c7541260ba5 (patch)
tree642306a441fef31ca0bfb60021192db9d3f942d6 /sql/sql_yacc_ora.yy
parent023c789a55ded6cbda0b7e6e1a34d34180adb1e6 (diff)
downloadmariadb-git-fdcc95143de96ce12b5c0c84e07f4c7541260ba5.tar.gz
sql_yacc_ora.yy: mering MDEV-13384 "window" seems like a reserved column name but it's not listed as one
Merging MDEV-13384 changes from sql_yacc.yy to sql_yacc_ora.yy
Diffstat (limited to 'sql/sql_yacc_ora.yy')
-rw-r--r--sql/sql_yacc_ora.yy24
1 files changed, 19 insertions, 5 deletions
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index 8992e9ce9ad..a4491258906 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -610,7 +610,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token PACKAGE_SYM /* Oracle-R */
%token RAISE_SYM /* Oracle-PLSQL-R */
%token ROWTYPE_SYM /* Oracle-PLSQL-R */
-%token WINDOW_SYM
/*
Non-reserved keywords
@@ -1026,6 +1025,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%token <kwd> WARNINGS
%token <kwd> WEEK_SYM
%token <kwd> WEIGHT_STRING_SYM
+%token <kwd> WINDOW_SYM /* SQL-2003-R */
%token <kwd> WITHIN
%token <kwd> WITHOUT /* SQL-2003-R */
%token <kwd> WORK_SYM /* SQL-2003-N */
@@ -1101,8 +1101,9 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
IDENT_sys
ident
label_ident
- ident_or_empty
sp_decl_ident
+ ident_or_empty
+ ident_table_alias
ident_directly_assignable
%type <lex_string_with_metadata>
@@ -1120,6 +1121,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
%type <kwd>
keyword keyword_sp
+ keyword_alias
keyword_directly_assignable
keyword_directly_not_assignable
keyword_sp_data_type
@@ -12019,7 +12021,7 @@ table_alias:
opt_table_alias:
/* empty */ { $$=0; }
- | table_alias ident
+ | table_alias ident_table_alias
{
$$= (LEX_CSTRING*) thd->memdup(&$2,sizeof(LEX_STRING));
if (unlikely($$ == NULL))
@@ -14997,6 +14999,15 @@ TEXT_STRING_filesystem:
}
;
+ident_table_alias:
+ IDENT_sys
+ | keyword_alias
+ {
+ if (unlikely($$.copy_keyword(thd, &$1)))
+ MYSQL_YYABORT;
+ }
+ ;
+
ident:
IDENT_sys
| keyword
@@ -15114,14 +15125,17 @@ user: user_maybe_role
}
;
-/* Keyword that we allow for identifiers (except SP labels) */
-keyword:
+/* Keywords which we allow as table aliases. */
+keyword_alias:
keyword_sp
| keyword_directly_assignable
| keyword_directly_not_assignable
;
+/* Keyword that we allow for identifiers (except SP labels) */
+keyword: keyword_alias | WINDOW_SYM;
+
/*
Keywords that we allow in Oracle-style direct assignments:
xxx := 10;