Commit 35e43471 authored by Dmitry Shulga's avatar Dmitry Shulga

MDEV-14959: Control over memory allocated for SP/PS

Use sp_head::executed_counter only for debug output. The decision
to mark sp_head's mem_root as read only is performed based on
the fact that every SP instruction has been executed at least once.
parent d8721f0d
...@@ -1598,11 +1598,11 @@ sp_head::execute(THD *thd, bool merge_da_on_success) ...@@ -1598,11 +1598,11 @@ sp_head::execute(THD *thd, bool merge_da_on_success)
if (!err_status) if (!err_status)
{ {
if (!main_mem_root.read_only && if (!main_mem_root.read_only &&
has_all_instrs_executed() && has_all_instrs_executed())
++executed_counter >= 2)
{ {
main_mem_root.read_only= 1; main_mem_root.read_only= 1;
} }
++executed_counter;
DBUG_PRINT("info", ("execute counter: %lu", executed_counter)); DBUG_PRINT("info", ("execute counter: %lu", executed_counter));
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment