diff options
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 54 |
1 files changed, 35 insertions, 19 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 921b461f15e..ece9d05c4fd 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -11228,20 +11228,25 @@ TABLE_LIST *ha_partition::get_next_global_for_child() const COND *ha_partition::cond_push(const COND *cond) { - handler **file= m_file; + uint i; COND *res_cond= NULL; DBUG_ENTER("ha_partition::cond_push"); - do + for (i= bitmap_get_first_set(&m_partitions_to_reset); + i < m_tot_parts; + i= bitmap_get_next_set(&m_partitions_to_reset, i)) { - if ((*file)->pushed_cond != cond) + if (bitmap_is_set(&m_opened_partitions, i)) { - if ((*file)->cond_push(cond)) - res_cond= (COND *) cond; - else - (*file)->pushed_cond= cond; + if (m_file[i]->pushed_cond != cond) + { + if (m_file[i]->cond_push(cond)) + res_cond= (COND *) cond; + else + m_file[i]->pushed_cond= cond; + } } - } while (*(++file)); + } DBUG_RETURN(res_cond); } @@ -11253,13 +11258,18 @@ const COND *ha_partition::cond_push(const COND *cond) void ha_partition::cond_pop() { - handler **file= m_file; + uint i; DBUG_ENTER("ha_partition::cond_pop"); - do + for (i= bitmap_get_first_set(&m_partitions_to_reset); + i < m_tot_parts; + i= bitmap_get_next_set(&m_partitions_to_reset, i)) { - (*file)->cond_pop(); - } while (*(++file)); + if (bitmap_is_set(&m_opened_partitions, i)) + { + m_file[i]->cond_pop(); + } + } DBUG_VOID_RETURN; } @@ -11849,16 +11859,22 @@ int ha_partition::pre_direct_delete_rows() int ha_partition::info_push(uint info_type, void *info) { - int error= 0; - handler **file= m_file; + int error= 0, tmp; + uint i; DBUG_ENTER("ha_partition::info_push"); - do + for (i= bitmap_get_first_set(&m_partitions_to_reset); + i < m_tot_parts; + i= bitmap_get_next_set(&m_partitions_to_reset, i)) { - int tmp; - if ((tmp= (*file)->info_push(info_type, info))) - error= tmp; - } while (*(++file)); + if (bitmap_is_set(&m_opened_partitions, i)) + { + if ((tmp= m_file[i]->info_push(info_type, info))) + { + error= tmp; + } + } + } DBUG_RETURN(error); } |