You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
fix(memory leaks): MCOL-5791 - get rid of memory leaks in plugin code (#3365)
There were numerous memory leaks in plugin's code and associated code. During typical run of MTR tests it leaked around 65 megabytes of objects. As a result they may severely affect long-lived connections. This patch fixes (almost) all leaks found in the plugin. The exceptions are two leaks associated with SHOW CREATE TABLE columnstore_table and getting information of columns of columnstore-handled table. These should be fixed on the server side and work is on the way.
This commit is contained in:
@ -45,6 +45,8 @@ class SubQuery
|
||||
public:
|
||||
SubQuery(gp_walk_info& gwip) : fGwip(gwip), fCorrelated(false)
|
||||
{
|
||||
next = *gwip.subQueriesChain;
|
||||
*gwip.subQueriesChain = this;
|
||||
}
|
||||
virtual ~SubQuery()
|
||||
{
|
||||
@ -68,11 +70,28 @@ class SubQuery
|
||||
{
|
||||
}
|
||||
|
||||
SubQuery* next;
|
||||
protected:
|
||||
gp_walk_info& fGwip;
|
||||
bool fCorrelated;
|
||||
};
|
||||
|
||||
struct SubQueryChainHolder
|
||||
{
|
||||
SubQuery* chain;
|
||||
SubQueryChainHolder () : chain(nullptr) { }
|
||||
~SubQueryChainHolder ()
|
||||
{
|
||||
while (chain)
|
||||
{
|
||||
SubQuery* next = chain->next;
|
||||
delete chain;
|
||||
chain = next;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief A class to represent a generic WHERE clause subquery
|
||||
*/
|
||||
|
Reference in New Issue
Block a user