summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-12-04 13:18:14 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-12-04 13:18:14 +0200
commitb6f203984bc519a31ac695cbcb6de7f1f638d321 (patch)
tree5938cd9e0de716d6c5cb67d005a669685e0ce251 /sql/sql_union.cc
parent95f3c142a4f2fdb088e534a4349bb377d1af3098 (diff)
parent157d3c3bc109bf13c433d9d150ea0c47291ade0d (diff)
downloadmariadb-git-b6f203984bc519a31ac695cbcb6de7f1f638d321.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 6368ed8afd8..edf85c2084b 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1046,8 +1046,11 @@ bool st_select_lex_unit::prepare(TABLE_LIST *derived_arg,
0))
goto err;
if (!derived_arg->table)
- derived_arg->table= derived_arg->derived_result->table=
- with_element->rec_result->rec_tables.head();
+ {
+ derived_arg->table= with_element->rec_result->rec_tables.head();
+ if (derived_arg->derived_result)
+ derived_arg->derived_result->table= derived_arg->table;
+ }
with_element->mark_as_with_prepared_anchor();
is_rec_result_table_created= true;
}