• dlenev@mysql.com's avatar
    Fix for bug #17260 "Multiple invocations of triggers or stored functions · d8bc635e
    dlenev@mysql.com authored
    hog memory".
    
    During each invocation of stored function or trigger some objects which
    lifetime is one function call (e.g. sp_rcontext) were allocated on
    arena/memroot of calling statement. This led to consumption of fixed amount
    of memory for each function/trigger invocation and so statements which
    involve lot of them were hogging memory. This in its return led to OOM
    crashes or freezes.
    
    This fix introduces new memroot and arena for objects which lifetime is
    whole duration of function call. So all memory consumed by such objects
    is freed at the end of function call.
    d8bc635e
sp_head.cc 87.6 KB