summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy15
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index c5b75180c69..009840b03b8 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -597,7 +597,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
opt_table_alias
%type <table>
- table_ident references
+ table_ident table_ident_ref references
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
@@ -4623,8 +4623,13 @@ field_ident:
table_ident:
ident { $$=new Table_ident($1); }
| ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
- | '.' ident { $$=new Table_ident($2);}
- /* For Delphi */;
+ | '.' ident { $$=new Table_ident($2);} /* For Delphi */
+ ;
+
+table_ident_ref:
+ ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); }
+ | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
+ ;
IDENT_sys:
IDENT { $$= $1; }
@@ -5128,14 +5133,14 @@ handler:
if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0))
YYABORT;
}
- | HANDLER_SYM table_ident CLOSE_SYM
+ | HANDLER_SYM table_ident_ref CLOSE_SYM
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_HA_CLOSE;
if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
YYABORT;
}
- | HANDLER_SYM table_ident READ_SYM
+ | HANDLER_SYM table_ident_ref READ_SYM
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_HA_READ;