mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#11766249 bug#59316: PARTITIONING AND INDEX_MERGE MEMORY LEAK
Update for previous patch according to reviewers comments. Updated the constructors for ha_partitions to use the common init_handler_variables functions Added use of defines for size and offset to get better readability for the code that reads and writes the .par file. Also refactored the get_from_handler_file function.
This commit is contained in:
@@ -2045,14 +2045,21 @@ handler *handler::clone(const char *name, MEM_ROOT *mem_root)
|
||||
on this->table->mem_root and we will not be able to reclaim that memory
|
||||
when the clone handler object is destroyed.
|
||||
*/
|
||||
if (!(new_handler->ref= (uchar*) alloc_root(mem_root, ALIGN_SIZE(ref_length)*2)))
|
||||
return NULL;
|
||||
if (new_handler && !new_handler->ha_open(table,
|
||||
name,
|
||||
table->db_stat,
|
||||
HA_OPEN_IGNORE_IF_LOCKED))
|
||||
return new_handler;
|
||||
return NULL;
|
||||
if (new_handler &&
|
||||
!(new_handler->ref= (uchar*) alloc_root(mem_root,
|
||||
ALIGN_SIZE(ref_length)*2)))
|
||||
new_handler= NULL;
|
||||
/*
|
||||
TODO: Implement a more efficient way to have more than one index open for
|
||||
the same table instance. The ha_open call is not cachable for clone.
|
||||
*/
|
||||
if (new_handler && new_handler->ha_open(table,
|
||||
name,
|
||||
table->db_stat,
|
||||
HA_OPEN_IGNORE_IF_LOCKED))
|
||||
new_handler= NULL;
|
||||
|
||||
return new_handler;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user