summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <davi@endora.local>2007-12-19 21:01:48 -0200
committerunknown <davi@endora.local>2007-12-19 21:01:48 -0200
commit5473858b644f2b3c7b6aed186a4f39917af7248e (patch)
treef4d51114c116cf795b2caf114b7f1ae5455757ba /sql
parent62e111e60210c412a956355da4c4774c72f8a99a (diff)
parent660e91b19b0bbd373b0caedaa9a1dcc4ce5dddbb (diff)
downloadmariadb-git-5473858b644f2b3c7b6aed186a4f39917af7248e.tar.gz
Merge mysql.com:/Users/davi/mysql/bugs/28317-5.1
into mysql.com:/Users/davi/mysql/mysql-5.1-runtime sql/sql_yacc.yy: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_yacc.yy41
1 files changed, 17 insertions, 24 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b4d8bb2dfb8..72800c7485a 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -508,10 +508,10 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%pure_parser /* We have threads */
/*
- Currently there are 177 shift/reduce conflicts.
+ Currently there are 169 shift/reduce conflicts.
We should not introduce new conflicts any more.
*/
-%expect 177
+%expect 169
/*
Comments for TOKENS.
@@ -1193,7 +1193,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <table_list>
join_table_list join_table
- table_factor table_ref
+ table_factor table_ref esc_table_ref
select_derived derived_table_list
%type <date_time_type> date_time_type;
@@ -7444,10 +7444,22 @@ join_table_list:
derived_table_list { MYSQL_YYABORT_UNLESS($$=$1); }
;
+/*
+ The ODBC escape syntax for Outer Join is: '{' OJ join_table '}'
+ The parser does not define OJ as a token, any ident is accepted
+ instead in $2 (ident). Also, all productions from table_ref can
+ be escaped, not only join_table. Both syntax extensions are safe
+ and are ignored.
+*/
+esc_table_ref:
+ table_ref { $$=$1; }
+ | '{' ident table_ref '}' { $$=$3; }
+ ;
+
/* Warning - may return NULL in case of incomplete SELECT */
derived_table_list:
- table_ref { $$=$1; }
- | derived_table_list ',' table_ref
+ esc_table_ref { $$=$1; }
+ | derived_table_list ',' esc_table_ref
{
MYSQL_YYABORT_UNLESS($1 && ($$=$3));
}
@@ -7612,25 +7624,6 @@ table_factor:
MYSQL_YYABORT;
Select->add_joined_table($$);
}
- | '{' ident table_ref LEFT OUTER JOIN_SYM table_ref
- ON
- {
- /* Change the current name resolution context to a local context. */
- if (push_new_name_resolution_context(YYTHD, $3, $7))
- MYSQL_YYABORT;
-
- }
- expr '}'
- {
- LEX *lex= Lex;
- MYSQL_YYABORT_UNLESS($3 && $7);
- add_join_on($7,$10);
- Lex->pop_context();
- $7->outer_join|=JOIN_TYPE_LEFT;
- $$=$7;
- if (!($$= lex->current_select->nest_last_join(lex->thd)))
- MYSQL_YYABORT;
- }
| select_derived_init get_select_lex select_derived2
{
LEX *lex= Lex;