1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#12696518: MEMORY LEAKS IN HA_PARTITION (VALGRIND TESTS ON TRUNK)

(also 5.5+ solution for bug#11766879/bug#60106)

The valgrind warning was due to an unused 'new handler_add_index(...)'
which was never freed.

The error handling did not work (fails as in bug#11766879) and
the implementation was not as transparant as it could, therefore I
made it a bit simpler and more transparant to the underlying handlers.

This way it follows the api better and the error handling works and
is also now tested.

Also added a debug test to verify the error handling.

Improved according to Jon Olavs review:
Added class ha_partition_add_index.
Also added base class Sql_alloc to handler_add_index.
Update 3.
This commit is contained in:
Mattias Jonsson
2011-09-15 20:49:39 +02:00
parent 1a2b1ba6aa
commit 7d1cccae44
6 changed files with 331 additions and 48 deletions

View File

@ -1163,10 +1163,12 @@ uint calculate_key_len(TABLE *, uint, const uchar *, key_part_map);
/**
Index creation context.
Created by handler::add_index() and freed by handler::final_add_index().
Created by handler::add_index() and destroyed by handler::final_add_index().
And finally freed at the end of the statement.
(Sql_alloc does not free in delete).
*/
class handler_add_index
class handler_add_index : public Sql_alloc
{
public:
/* Table where the indexes are added */