1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Correction for the fix of the bug mdev-6874.

This commit is contained in:
Igor Babaev
2014-10-19 09:50:50 -07:00
parent ec89abfef4
commit d24919969a
4 changed files with 5 additions and 7 deletions

View File

@ -3397,7 +3397,8 @@ bool subselect_union_engine::no_rows()
/* Check if we got any rows when reading UNION result from temp. table: */ /* Check if we got any rows when reading UNION result from temp. table: */
return MY_TEST(!(unit->fake_select_lex ? return MY_TEST(!(unit->fake_select_lex ?
unit->fake_select_lex->join->send_records : unit->fake_select_lex->join->send_records :
((select_union_direct *) result)->send_records)); ((select_union_direct *)(unit->get_union_result()))
->send_records));
} }

View File

@ -4463,13 +4463,7 @@ public:
} }
void cleanup() 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; send_records= 0;
DBUG_ASSERT(false); /* purecov: inspected */
} }
void set_thd(THD *thd_arg) void set_thd(THD *thd_arg)
{ {

View File

@ -676,6 +676,7 @@ public:
List<Item> *get_unit_column_types(); 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(Explain_query *output);
int save_union_explain_part2(Explain_query *output); int save_union_explain_part2(Explain_query *output);
}; };

View File

@ -784,6 +784,8 @@ bool st_select_lex_unit::exec()
if (uncacheable || !item || !item->assigned() || describe) if (uncacheable || !item || !item->assigned() || describe)
{ {
if (!fake_select_lex)
union_result->cleanup();
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{ {
ha_rows records_at_start= 0; ha_rows records_at_start= 0;