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.yy4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index e968dd12ca0..4e3629080be 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -9823,7 +9823,9 @@ table_factor:
lex->nest_level--;
}
else if (($3->select_lex &&
- $3->select_lex->master_unit()->is_union()) || $5)
+ $3->select_lex->master_unit()->is_union() &&
+ ($3->select_lex->master_unit()->first_select() ==
+ $3->select_lex || !$3->lifted)) || $5)
{
/* simple nested joins cannot have aliases or unions */
my_parse_error(ER(ER_SYNTAX_ERROR));