1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-05 15:41:14 +03:00

fix(memory leaks): MCOL-5791 - get rid of memory leaks in plugin code

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:
Serguey Zefirov
2024-09-30 14:50:35 +03:00
committed by Sergey Zefirov
parent 6445f4dff3
commit 38fd96a663
31 changed files with 472 additions and 229 deletions

View File

@ -316,7 +316,7 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
Item_window_func* wf = (Item_window_func*)item;
Item_sum* item_sum = wf->window_func();
string funcName = ConvertFuncName(item_sum);
WindowFunctionColumn* ac = new WindowFunctionColumn(funcName);
std::unique_ptr<WindowFunctionColumn> ac(new WindowFunctionColumn(funcName));
ac->timeZone(gwi.timeZone);
ac->distinct(item_sum->has_with_distinct());
Window_spec* win_spec = wf->window_spec;
@ -902,8 +902,10 @@ ReturnedColumn* buildWindowFunctionColumn(Item* item, gp_walk_info& gwi, bool& n
ac->charsetNumber(item->collation.collation->number);
// put ac on windowFuncList
gwi.windowFuncList.push_back(ac);
return ac;
// we clone our managed pointer to put it into uunmanaged world.
WindowFunctionColumn* retAC = ac.release();
gwi.windowFuncList.push_back(retAC);
return retAC;
}
} // namespace cal_impl_if