mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge branch '10.11' into 11.0
This commit is contained in:
@ -480,7 +480,7 @@ bool select_unit_ext::disable_index_if_needed(SELECT_LEX *curr_sl)
|
||||
!curr_sl->next_select()) )
|
||||
{
|
||||
is_index_enabled= false;
|
||||
if (table->file->ha_disable_indexes(HA_KEY_SWITCH_ALL))
|
||||
if (table->file->ha_disable_indexes(key_map(0), false))
|
||||
return false;
|
||||
table->no_keyread=1;
|
||||
return true;
|
||||
@ -1260,26 +1260,21 @@ bool st_select_lex_unit::join_union_item_types(THD *thd_arg,
|
||||
}
|
||||
|
||||
|
||||
bool init_item_int(THD* thd, Item_int* &item)
|
||||
static bool init_item_int(THD* thd, Item_int* &item)
|
||||
{
|
||||
if (!item)
|
||||
{
|
||||
Query_arena *arena, backup_arena;
|
||||
arena= thd->activate_stmt_arena_if_needed(&backup_arena);
|
||||
|
||||
item= new (thd->mem_root) Item_int(thd, 0);
|
||||
|
||||
if (arena)
|
||||
thd->restore_active_arena(arena, &backup_arena);
|
||||
|
||||
if (!item)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->value= 0;
|
||||
}
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -1759,8 +1754,12 @@ cont:
|
||||
|
||||
for(uint i= 0; i< hidden; i++)
|
||||
{
|
||||
init_item_int(thd, addon_fields[i]);
|
||||
types.push_front(addon_fields[i]);
|
||||
if (init_item_int(thd, addon_fields[i]) ||
|
||||
types.push_front(addon_fields[i]))
|
||||
{
|
||||
types.empty();
|
||||
goto err;
|
||||
}
|
||||
addon_fields[i]->name.str= i ? "__CNT_1" : "__CNT_2";
|
||||
addon_fields[i]->name.length= 7;
|
||||
}
|
||||
@ -2084,7 +2083,7 @@ bool st_select_lex_unit::optimize()
|
||||
/* re-enabling indexes for next subselect iteration */
|
||||
if ((union_result->force_enable_index_if_needed() || union_distinct))
|
||||
{
|
||||
if(table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL))
|
||||
if(table->file->ha_enable_indexes(key_map(table->s->keys), false))
|
||||
DBUG_ASSERT(0);
|
||||
else
|
||||
table->no_keyread= 0;
|
||||
@ -2184,7 +2183,7 @@ bool st_select_lex_unit::exec()
|
||||
union_result->table && union_result->table->is_created())
|
||||
{
|
||||
union_result->table->file->ha_delete_all_rows();
|
||||
union_result->table->file->ha_enable_indexes(HA_KEY_SWITCH_ALL);
|
||||
union_result->table->file->ha_enable_indexes(key_map(table->s->keys), false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2251,7 +2250,7 @@ bool st_select_lex_unit::exec()
|
||||
{
|
||||
// This is UNION DISTINCT, so there should be a fake_select_lex
|
||||
DBUG_ASSERT(fake_select_lex != NULL);
|
||||
if (unlikely(table->file->ha_disable_indexes(HA_KEY_SWITCH_ALL)))
|
||||
if (table->file->ha_disable_indexes(key_map(0), false))
|
||||
DBUG_RETURN(TRUE);
|
||||
table->no_keyread=1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user