summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index f9a1908355b..0be554f58a2 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -229,8 +229,12 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
(ORDER*) 0 : (ORDER *)sl->order_list.first,
(ORDER*) sl->group_list.first,
sl->having,
- (ORDER*) NULL,
+ (is_union ? (ORDER*) 0 :
+ (ORDER*) thd_arg->lex->proc_list.first),
sl, this);
+ /* There are no * in the statement anymore (for PS) */
+ sl->with_wild= 0;
+ last_procedure= join->procedure;
if (res || thd_arg->is_fatal_error)
goto err;
if (sl == first_select)
@@ -344,7 +348,8 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
0, 0,
fake_select_lex->order_list.elements,
(ORDER*) fake_select_lex->order_list.first,
- (ORDER*) NULL, NULL, (ORDER*) NULL,
+ (ORDER*) NULL, NULL,
+ (ORDER*) NULL,
fake_select_lex, this);
fake_select_lex->table_list.empty();
}