summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2021-09-30 15:57:32 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2021-09-30 15:57:32 +0400
commit39efcfbf9d9a69f8e40275f02d87328cf6c082f7 (patch)
tree10d05680e3c2ac0f1b70d4187d996aca6b0a8851 /sql/sql_class.cc
parent3690c549c6e72646ba74f6b4c83813ee4ac3aea4 (diff)
downloadmariadb-git-bb-10.2-hf.tar.gz
MDEV-24383 SIGSEGV in heap_info from make_join_statistics on 2nd SP exec.bb-10.2-hf
Since some optimizer switches lead to the changes in the parser-generated structures, we have to reload cached SP-s after the change.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 5ada018e540..dcfdf40c964 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1353,8 +1353,7 @@ void THD::change_user(void)
my_hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(my_hash_get_key) get_var_key,
(my_hash_free_key) free_user_var, 0);
- sp_cache_clear(&sp_proc_cache);
- sp_cache_clear(&sp_func_cache);
+ clear_sp_caches();
}
@@ -1410,8 +1409,7 @@ void THD::cleanup(void)
#endif /* defined(ENABLED_DEBUG_SYNC) */
my_hash_free(&user_vars);
- sp_cache_clear(&sp_proc_cache);
- sp_cache_clear(&sp_func_cache);
+ clear_sp_caches();
auto_inc_intervals_forced.empty();
auto_inc_intervals_in_cur_stmt_for_binlog.empty();
@@ -2123,6 +2121,13 @@ void THD::cleanup_after_query()
}
+void THD::clear_sp_caches()
+{
+ sp_cache_clear(&sp_proc_cache);
+ sp_cache_clear(&sp_func_cache);
+}
+
+
/*
Convert a string to another character set