summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2019-08-31 22:44:58 -0700
committerIgor Babaev <igor@askmonty.org>2019-08-31 22:44:58 -0700
commitc9fe6fbb61428e2d40f1de085ebdae505935b362 (patch)
treea41f750c79542b790866e6e50a4e82ad45970a7f
parent2707af2dec65ffd4195b9d79a233b1f298fe1756 (diff)
downloadmariadb-git-c9fe6fbb61428e2d40f1de085ebdae505935b362.tar.gz
Merge branch 'mdev-18844' of https://github.com/waynexia/server into mdev-18844bb-mdev-18844
-rw-r--r--sql/sql_union.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 1abc81bcdff..a7d0d08feb2 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -858,7 +858,7 @@ bool select_unit_ext::send_eof()
}
if (curr_op_type == INTERSECT_ALL)
{
- longlong add_cnt= additional_cnt->val_int();
+ ha_rows add_cnt= (ha_rows)additional_cnt->val_int();
if (dup_cnt > add_cnt && add_cnt > 0)
dup_cnt= (ha_rows)add_cnt;
}
@@ -2171,7 +2171,8 @@ bool st_select_lex_unit::exec()
sl->tvc->exec(sl);
else
sl->join->exec();
- if (sl == union_distinct && !have_except_all_or_intersect_all)
+ if (sl == union_distinct && !have_except_all_or_intersect_all &&
+ !(with_element && with_element->is_recursive))
{
// This is UNION DISTINCT, so there should be a fake_select_lex
DBUG_ASSERT(fake_select_lex != NULL);