summaryrefslogtreecommitdiff
path: root/mysql-test/main/sp-lock.test
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-09-27 17:43:36 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-09-27 19:09:37 +0200
commit1f099418b6cce00b72f601288735bd7454d037cd (patch)
tree3a3b50780e621e67b6f5f2b695546825477de266 /mysql-test/main/sp-lock.test
parentd7aa81c862b5d813f8fe3440b7e011a555e88d96 (diff)
downloadmariadb-git-1f099418b6cce00b72f601288735bd7454d037cd.tar.gz
MDEV-20699 mysqldump of routines causes MariaDB to get killed by oom-killerbb-10.3-wlad-MDEV-20699
The reason for this behavior is that SP get cached, per connection. The stored_program_cache is size of this cache, which amounts to 256 routines by default. A compiled stored procedure can easily be several megabytes in size. Thus calling SHOW CREATE PROCEDURE for all stored procedures, like mysqldump does, can require significant amount of memory. Fixed by bypassing the cache for "SHOW CREATE". This should normally be fine also perfomance-wise, as cache is meant to be used for repeated execution, not repeated SHOW CREATEs. Added a test to verify that CREATE PROCEDURE + SHOW CREATE PROCEURE do not cache, i.e amount of allocated memory does not change. Note, there is a change in existing behavior in an edge case : If "SHOW CREATE PROCEDURE p1" called from p1, after p1 was altered, now this will now return altered code. Previour behavior - relied on caching and would return old code. The previous behavior might was not necessarily correct.
Diffstat (limited to 'mysql-test/main/sp-lock.test')
-rw-r--r--mysql-test/main/sp-lock.test3
1 files changed, 0 insertions, 3 deletions
diff --git a/mysql-test/main/sp-lock.test b/mysql-test/main/sp-lock.test
index 83ea07d4bda..703c59e8f28 100644
--- a/mysql-test/main/sp-lock.test
+++ b/mysql-test/main/sp-lock.test
@@ -807,9 +807,6 @@ connection default;
--echo #
--echo # SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
--echo #
---echo # We are just covering the existing behaviour with tests. The
---echo # results are not necessarily correct."
---echo #
delimiter |;
CREATE PROCEDURE p1()