diff options
author | unknown <petr@mysql.com> | 2005-08-18 11:23:54 +0200 |
---|---|---|
committer | unknown <petr@mysql.com> | 2005-08-18 11:23:54 +0200 |
commit | 026c1f55d9643dfce587dc9a6a6d26aac70d3e10 (patch) | |
tree | fd960682f9ed076d0614c2f4de630337c54c2517 /sql/sp_rcontext.h | |
parent | 99bea6a74d48e215d5f2c4c85512f09b4888d9d1 (diff) | |
download | mariadb-git-026c1f55d9643dfce587dc9a6a6d26aac70d3e10.tar.gz |
Fix for Bug#11247 Stored procedures: Function calls in long loops leak memory
and Bug#12297 SP crashes the server if data inserted inside a lon loop
Third commit attempt. With fixes to the issues, showed up after full rebuild and
tests on other hosts.
mysql-test/r/rpl_sp.result:
New warnings appeared in result file, as now we always create spcont in a stored routine.
This is correct behaviour. We swallowed some warnings, as we used thd->spcont to check whether
we are in the SP though we didn't set spcont in certain cases. This is fixed now.
mysql-test/r/sp.result:
fixed result file to reflect new tests
mysql-test/t/sp.test:
Added tests for bugs. Though one of them is disabled, as it fails because of the other bug.
It should be enabled, when bug 12297 is fixed.
sql/sp_head.cc:
Per-instruction arena is implemented
sql/sp_rcontext.cc:
Now we should deal with callers_arena->free_list when we employ reuse mechanism with callers_arena
switched during sp_eval_func_item
sql/sp_rcontext.h:
Add new member to sp_rcontext class, in order to handle instructions with assignment
and/or with nested SP processing properly.
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r-- | sql/sp_rcontext.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h index 856beb13f6d..dedbc7bdef1 100644 --- a/sql/sp_rcontext.h +++ b/sql/sp_rcontext.h @@ -48,8 +48,14 @@ class sp_rcontext : public Sql_alloc public: - MEM_ROOT *callers_mem_root; // Used to store result fields bool in_handler; + /* + Arena used to (re) allocate items on . E.g. reallocate INOUT/OUT + SP parameters when they don't fit into prealloced items. This + is common situation with String items. It is used mainly in + sp_eval_func_item(). + */ + Query_arena *callers_arena; sp_rcontext(uint fsize, uint hmax, uint cmax); |