summaryrefslogtreecommitdiff
path: root/sql/sys_vars.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/sys_vars.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/sys_vars.cc')
-rw-r--r--sql/sys_vars.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index e4de3d8d0aa..585806fdce5 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -53,6 +53,7 @@
#include "log_slow.h"
#include "debug_sync.h" // DEBUG_SYNC
#include "sql_show.h"
+#include "sp_cache.h" // sp_cache_invalidate()
#include "log_event.h"
#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
@@ -2469,6 +2470,11 @@ static bool fix_optimizer_switch(sys_var *self, THD *thd,
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
ER_THD(thd, ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
"engine_condition_pushdown=on");
+ if (type == OPT_GLOBAL)
+ sp_cache_invalidate();
+ else
+ thd->clear_sp_caches();
+
return false;
}
static bool check_legal_optimizer_switch(sys_var *self, THD *thd,