summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2018-05-17 22:56:27 -0700
committerIgor Babaev <igor@askmonty.org>2018-05-17 22:58:21 -0700
commitde86997160ea5e02e7fc6eb877d5823e96b64523 (patch)
treed841fc4cad41d13437fbce025151b5b68cdeccd3 /sql/sql_yacc.yy
parent52c98bf830cc14948f6a950961c77d64d20677a6 (diff)
downloadmariadb-git-de86997160ea5e02e7fc6eb877d5823e96b64523.tar.gz
MDEV-15581 Incorrect result (missing row) with UNION DISTINCT in anchor parts
The current code does not support recursive CTEs whose specifications contain a mix of ALL UNION and DISTINCT UNION operations. This patch catches such specifications and reports errors for them.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index b2088b0e640..47e5f2f9402 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -707,6 +707,7 @@ bool add_select_to_union_list(LEX *lex, bool is_union_distinct,
return TRUE;
mysql_init_select(lex);
lex->current_select->linkage=UNION_TYPE;
+ lex->current_select->with_all_modifier= !is_union_distinct;
if (is_union_distinct) /* UNION DISTINCT - remember position */
lex->current_select->master_unit()->union_distinct=
lex->current_select;