-
unknown authored
Memory leak in locally evalutated expressions during SP execution fixed by reusing allocated item slots when possible. Note: No test case added, since the test is a stress test that tries to make the machine to run out of memory. Second attempt, now tested with debug build, valgrind build, max (optimized) build, with and without --debug, --vagrind and --ps-protocol. Errors in trigger and view test with --debug in debug build where present before this patch, and likewise for valgrind warnings for view test in valgrind build with --ps-protocol. sql/item.cc: Init rsize in Item (for SP item reusal). sql/item.h: Addes special new operator for reuse of Items, for SP internal use only. sql/sp_head.cc: Reuse items assigned internally in SPs when possible. sql/sp_rcontext.cc: Reuse items assigned internally in SPs when possible. Moved the local variable assignment here (from sp_head) to avoid duplicated code. sql/sp_rcontext.h: New arg to sp_rcontext::set_item_eval() (and some coding style). sql/sql_class.cc: Adjusted call to new set_item_eval().
c6f2053a