summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-09-15 20:49:39 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-09-15 20:49:39 +0200
commit7d1cccae44dbf21bc7d935552fd5ec0968752833 (patch)
tree2e0c5c3951ea9c5742508de17b2790c27bfbc4bc /sql/handler.h
parent1a2b1ba6aa972b622b41417171f51998d5753c7d (diff)
downloadmariadb-git-7d1cccae44dbf21bc7d935552fd5ec0968752833.tar.gz
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.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/handler.h b/sql/handler.h
index d1222cb56a6..cbdfc231ed5 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -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 */