summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 08:18:32 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-09-30 08:18:32 +0300
commit57fdd016ce6167c15ba9cd41048b8a42ba582447 (patch)
treee48e0869d82883d4b995bc7a0b6f57c94e5106a8
parenta10b63bf58795335b96281bfc22169c9b8613037 (diff)
parent333d6c30f87a7862a2d6ca379c49e2ea46451ebc (diff)
downloadmariadb-git-57fdd016ce6167c15ba9cd41048b8a42ba582447.tar.gz
Merge 10.3 into 10.4
-rw-r--r--mysql-test/main/lock_sync.result3
-rw-r--r--mysql-test/main/lock_sync.test3
-rw-r--r--sql/sp.cc8
3 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/main/lock_sync.result b/mysql-test/main/lock_sync.result
index 70960503fef..25b97460238 100644
--- a/mysql-test/main/lock_sync.result
+++ b/mysql-test/main/lock_sync.result
@@ -221,6 +221,8 @@ end|
# called below.
#
connection con1;
+set @save_dbug=@@debug_dbug;
+set debug_dbug="+d,cache_sp_in_show_create";
# Cache all functions used in the tests below so statements
# calling them won't need to open and lock mysql.proc table
# and we can assume that each statement locks its tables
@@ -245,6 +247,7 @@ show create function f14;
show create function f15;
show create function f16;
show create function f17;
+set debug_dbug=@save_dbug;
connection default;
#
# 1. Statements that read tables and do not use subqueries.
diff --git a/mysql-test/main/lock_sync.test b/mysql-test/main/lock_sync.test
index 1a8cd7bdbd3..ed0ae19f921 100644
--- a/mysql-test/main/lock_sync.test
+++ b/mysql-test/main/lock_sync.test
@@ -232,6 +232,8 @@ let $con_aux2= con2;
let $table= t1;
connection con1;
+set @save_dbug=@@debug_dbug;
+set debug_dbug="+d,cache_sp_in_show_create";
--echo # Cache all functions used in the tests below so statements
--echo # calling them won't need to open and lock mysql.proc table
--echo # and we can assume that each statement locks its tables
@@ -257,6 +259,7 @@ show create function f14;
show create function f15;
show create function f16;
show create function f17;
+set debug_dbug=@save_dbug;
--enable_result_log
connection default;
diff --git a/sql/sp.cc b/sql/sp.cc
index b566d41c857..56c59fcf696 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1904,6 +1904,14 @@ Sp_handler::sp_show_create_routine(THD *thd,
of the binary log or the query cache, which currently it does not.
*/
sp_head *sp= 0;
+
+ DBUG_EXECUTE_IF("cache_sp_in_show_create",
+ /* Some tests need just need a way to cache SP without other side-effects.*/
+ sp_cache_routine(thd, name, false, &sp);
+ sp->show_create_routine(thd, this);
+ DBUG_RETURN(false);
+ );
+
bool free_sp= db_find_routine(thd, name, &sp) == SP_OK;
bool ret= !sp || sp->show_create_routine(thd, this);
if (ret)