1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

BUG#26117 "index_merge sort-union over partitioned table crashes"

Before the fix: 
  ha_partition objects had ha_partition::m_part_info==NULL and that caused
  crash
After: 
- The new ha_partition::clone() function makes the clones use parent's
  m_part_info value.
- The parent ha_partition object remains responsible for deallocation of
  m_part_info.


mysql-test/r/partition_innodb.result:
  BUG#26117 "index_merge sort-union over partitioned table crashes"
   - Testcase
mysql-test/t/partition_innodb.test:
  BUG#26117 "index_merge sort-union over partitioned table crashes"
   - Testcase
This commit is contained in:
unknown
2007-02-27 22:01:03 +03:00
parent 5b64b12c7f
commit b68a22019e
4 changed files with 135 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ static uint alter_table_flags(uint flags __attribute__((unused)))
ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
:handler(hton, share), m_part_info(NULL), m_create_handler(FALSE),
m_is_sub_partitioned(0)
m_is_sub_partitioned(0), is_clone(FALSE)
{
DBUG_ENTER("ha_partition::ha_partition(table)");
init_handler_variables();
@@ -180,8 +180,7 @@ ha_partition::ha_partition(handlerton *hton, TABLE_SHARE *share)
ha_partition::ha_partition(handlerton *hton, partition_info *part_info)
:handler(hton, NULL), m_part_info(part_info),
m_create_handler(TRUE),
m_is_sub_partitioned(m_part_info->is_sub_partitioned())
m_is_sub_partitioned(m_part_info->is_sub_partitioned()), is_clone(FALSE)
{
DBUG_ENTER("ha_partition::ha_partition(part_info)");
init_handler_variables();
@@ -2320,6 +2319,19 @@ err_handler:
DBUG_RETURN(error);
}
handler *ha_partition::clone(MEM_ROOT *mem_root)
{
handler *new_handler= get_new_handler(table->s, mem_root, table->s->db_type);
((ha_partition*)new_handler)->m_part_info= m_part_info;
((ha_partition*)new_handler)->is_clone= TRUE;
if (new_handler && !new_handler->ha_open(table,
table->s->normalized_path.str,
table->db_stat,
HA_OPEN_IGNORE_IF_LOCKED))
return new_handler;
return NULL;
}
/*
Close handler object
@@ -2346,7 +2358,8 @@ int ha_partition::close(void)
DBUG_ENTER("ha_partition::close");
delete_queue(&m_queue);
bitmap_free(&(m_part_info->used_partitions));
if (!is_clone)
bitmap_free(&(m_part_info->used_partitions));
file= m_file;
repeat: