Skip to content

Commit 3c63460

Browse files
committed
Parser: SYSTEM_TIME_SYM (fixes #67)
1 parent 7d815be commit 3c63460

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

sql/gen_lex_token.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ void compute_tokens()
132132

133133
set_token(WITH_CUBE_SYM, "WITH CUBE");
134134
set_token(WITH_ROLLUP_SYM, "WITH ROLLUP");
135+
set_token(WITH_SYSTEM_SYM, "WITH SYSTEM");
136+
set_token(FOR_SYSTEM_TIME_SYM, "FOR SYSTEM_TIME");
135137
set_token(NOT2_SYM, "!");
136138
set_token(OR2_SYM, "|");
137139
set_token(PARAM_MARKER, "?");

sql/sql_lex.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,8 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
13331333
return WITH_CUBE_SYM;
13341334
case ROLLUP_SYM:
13351335
return WITH_ROLLUP_SYM;
1336+
case SYSTEM:
1337+
return WITH_SYSTEM_SYM;
13361338
default:
13371339
/*
13381340
Save the token following 'WITH'

sql/sql_yacc.yy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,10 +859,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
859859
%parse-param { THD *thd }
860860
%lex-param { THD *thd }
861861
/*
862-
Currently there are 106 shift/reduce conflicts.
862+
Currently there are 103 shift/reduce conflicts.
863863
We should not introduce new conflicts any more.
864864
*/
865-
%expect 106
865+
%expect 103
866866

867867
/*
868868
Comments for TOKENS.
@@ -1093,7 +1093,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
10931093
%token FORCE_SYM
10941094
%token FOREIGN /* SQL-2003-R */
10951095
%token FOR_SYM /* SQL-2003-R */
1096-
%token FOR_SYSTEM_TIME_SYM /* internal */
1096+
%token FOR_SYSTEM_TIME_SYM /* INTERNAL */
10971097
%token FORMAT_SYM
10981098
%token FOUND_SYM /* SQL-2003-R */
10991099
%token FROM
@@ -1575,6 +1575,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
15751575
%token WITHOUT /* SQL-2003-R */
15761576
%token WITH_CUBE_SYM /* INTERNAL */
15771577
%token WITH_ROLLUP_SYM /* INTERNAL */
1578+
%token WITH_SYSTEM_SYM /* INTERNAL */
15781579
%token WORK_SYM /* SQL-2003-N */
15791580
%token WRAPPER_SYM
15801581
%token WRITE_SYM /* SQL-2003-N */
@@ -5849,7 +5850,7 @@ create_table_option:
58495850
Lex->create_info.used_fields|= HA_CREATE_USED_SEQUENCE;
58505851
Lex->create_info.sequence= $3;
58515852
}
5852-
| WITH SYSTEM VERSIONING
5853+
| WITH_SYSTEM_SYM VERSIONING
58535854
{
58545855
Vers_parse_info &info= Lex->vers_get_info();
58555856
info.declared_system_versioning= true;
@@ -6666,7 +6667,7 @@ serial_attribute:
66666667
new (thd->mem_root)
66676668
engine_option_value($1, &Lex->last_field->option_list, &Lex->option_list_last);
66686669
}
6669-
| WITH SYSTEM VERSIONING
6670+
| WITH_SYSTEM_SYM VERSIONING
66706671
{
66716672
Lex->last_field->versioning = Column_definition::WITH_VERSIONING;
66726673
Lex->create_info.vers_info.has_versioned_fields= true;

0 commit comments

Comments
 (0)