Skip to content

Commit

Permalink
Correction for the fix of the bug mdev-6874.
Browse files Browse the repository at this point in the history
  • Loading branch information
igorbabaev committed Oct 19, 2014
1 parent ec89abf commit d249199
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion sql/item_subselect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3397,7 +3397,8 @@ bool subselect_union_engine::no_rows()
/* Check if we got any rows when reading UNION result from temp. table: */
return MY_TEST(!(unit->fake_select_lex ?
unit->fake_select_lex->join->send_records :
((select_union_direct *) result)->send_records));
((select_union_direct *)(unit->get_union_result()))
->send_records));
}


Expand Down
6 changes: 0 additions & 6 deletions sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -4463,13 +4463,7 @@ class select_union_direct :public select_union
}
void cleanup()
{
/*
Only called for top-level select_results, usually select_send,
and for the results of subquery engines
(select_<something>_subselect).
*/
send_records= 0;
DBUG_ASSERT(false); /* purecov: inspected */
}
void set_thd(THD *thd_arg)
{
Expand Down
1 change: 1 addition & 0 deletions sql/sql_lex.h
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ class st_select_lex_unit: public st_select_lex_node {

List<Item> *get_unit_column_types();

select_union *get_union_result() { return union_result; }
int save_union_explain(Explain_query *output);
int save_union_explain_part2(Explain_query *output);
};
Expand Down
2 changes: 2 additions & 0 deletions sql/sql_union.cc
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ bool st_select_lex_unit::exec()

if (uncacheable || !item || !item->assigned() || describe)
{
if (!fake_select_lex)
union_result->cleanup();
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{
ha_rows records_at_start= 0;
Expand Down

0 comments on commit d249199

Please sign in to comment.