Commit 49680497 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-11084 Select statement with partition selection against MyISAM

table opens all partitions.

Not-used partitions are not closed now.
parent 9df0eab3
......@@ -8351,7 +8351,7 @@ int ha_partition::open_read_partitions(char *name_buff, size_t name_buff_size)
{
handler **file;
char *name_buffer_ptr;
int error;
int error= 0;
name_buffer_ptr= m_name_buffer_ptr;
file= m_file;
......@@ -8362,13 +8362,20 @@ int ha_partition::open_read_partitions(char *name_buff, size_t name_buff_size)
int is_open= bitmap_is_set(&m_opened_partitions, n_file);
int should_be_open= bitmap_is_set(&m_part_info->read_partitions, n_file);
if (is_open && !should_be_open)
{
if ((error= (*file)->ha_close()))
goto err_handler;
bitmap_clear_bit(&m_opened_partitions, n_file);
}
else if (!is_open && should_be_open)
/*
TODO: we can close some opened partitions if they're not
used in the query. It probably should be syncronized with the
table_open_cache value.
if (is_open && !should_be_open)
{
if ((error= (*file)->ha_close()))
goto err_handler;
bitmap_clear_bit(&m_opened_partitions, n_file);
}
else
*/
if (!is_open && should_be_open)
{
LEX_CSTRING save_connect_string= table->s->connect_string;
if ((error= create_partition_name(name_buff, name_buff_size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment