1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

asserting table->file->enable_indexes() in union re-execution

This commit is contained in:
serg@serg.mylan
2004-05-21 09:31:28 +02:00
parent 40711b570a
commit 11128fb672

View File

@ -355,15 +355,18 @@ int st_select_lex_unit::exec()
if (uncacheable || !item || !item->assigned() || describe) if (uncacheable || !item || !item->assigned() || describe)
{ {
if (optimized && item && item->assigned()) if (optimized && item)
{
if (item->assigned())
{ {
item->assigned(0); // We will reinit & rexecute unit item->assigned(0); // We will reinit & rexecute unit
item->reset(); item->reset();
table->file->delete_all_rows(); table->file->delete_all_rows();
} }
if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL) && /* re-enabling indexes for next subselect iteration */
!describe) if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL))
DBUG_RETURN(1); // For sub-selects DBUG_ASSERT(1);
}
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;