Commit 94f83b26 authored by kevg's avatar kevg Committed by Aleksey Midenkov

SQL: fix assertion failure in parser [closes #119]

parent 64be66b6
......@@ -1368,19 +1368,6 @@ int MYSQLlex(YYSTYPE *yylval, THD *thd)
return FOR_SYM;
}
break;
case QUERY_SYM:
token= lex_one_token(yylval, thd);
lip->add_digest_token(token, yylval);
switch(token) {
case FOR_SYM:
return QUERY_FOR_SYM;
default:
lip->lookahead_yylval= lip->yylval;
lip->yylval= NULL;
lip->lookahead_token= token;
return QUERY_SYM;
}
break;
default:
break;
}
......
......@@ -861,10 +861,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%parse-param { THD *thd }
%lex-param { THD *thd }
/*
Currently there are 103 shift/reduce conflicts.
Currently there are 106 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
%expect 103
%expect 106
/*
Comments for TOKENS.
......@@ -1353,7 +1353,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%token PURGE
%token QUARTER_SYM
%token QUERY_SYM
%token QUERY_FOR_SYM /* INTERNAL */
%token QUICK
%token RAISE_SYM /* Oracle-PLSQL-R */
%token RANGE_SYM /* SQL-2003-R */
......@@ -8813,7 +8812,7 @@ trans_or_timestamp:
opt_query_for_system_time_clause:
/* empty */
{}
| QUERY_FOR_SYM SYSTEM_TIME_SYM for_system_time_expr
| QUERY_SYM FOR_SYSTEM_TIME_SYM for_system_time_expr
{
DBUG_ASSERT(Select);
Select->vers_conditions= Lex->vers_conditions;
......@@ -11690,15 +11689,21 @@ date_time_type:
| TIMESTAMP {$$=MYSQL_TIMESTAMP_DATETIME;}
;
table_alias:
/* empty */
| AS
| '='
;
opt_table_alias:
/* empty */ { $$=0; }
| table_alias ident
| ident
{
$$= (LEX_STRING*) thd->memdup(&$1,sizeof(LEX_STRING));
if ($$ == NULL)
MYSQL_YYABORT;
}
| AS ident
{
$$= (LEX_STRING*) thd->memdup(&$2,sizeof(LEX_STRING));
if ($$ == NULL)
MYSQL_YYABORT;
}
| '=' ident
{
$$= (LEX_STRING*) thd->memdup(&$2,sizeof(LEX_STRING));
if ($$ == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment