summaryrefslogtreecommitdiff
path: root/mysql-test/main/sp-condition-handler.test
Commit message (Collapse)AuthorAgeFilesLines
* MDEV-16584 SP with a cursor inside a loop wastes THD memory aggressivelyAlexander Barkov2018-06-281-0/+50
Problem: push_handler() created sp_handler_entry instances on THD::main_mem_root, which is freed only after the SP instructions execution. So in case of a CONTINUE HANDLER inside a loop (e.g. WHILE) this approach leaked thread memory on every loop iteration. Changes: - Removing sp_handler_entry declaration, it's not really needed. - Fixing the data type of sp_rcontext::m_handlers from Dynamic_array<sp_handler_entry*> to Dynamic_array<sp_instr_hpush_jump*> - Fixing sp_rcontext::push_handler() to push the pointer to an sp_instr_hpush_jump instance to the handler stack. This instance contains everything we need. There is no a need to allocate anything else.