summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2017-12-25 13:40:38 +0300
committerAleksey Midenkov <midenok@gmail.com>2017-12-26 15:24:48 +0300
commitb9bc8bbdc0fa2e9a3fa43dfef3ded9d8c95f70bd (patch)
tree98730803cfd6426f8aad36894c93313b70d1710a
parentd8aabb44b509da890d40d185c7b556ed47772108 (diff)
downloadmariadb-git-b9bc8bbdc0fa2e9a3fa43dfef3ded9d8c95f70bd.tar.gz
SQL: SP forced invalidate via 0
Invalidate via ULONG_MAX was wrong because sp_cache_flush_obsolete() works incorrectly in this case. Fixes MDEV-14749
-rw-r--r--sql/sp_cache.cc2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_select.cc2
-rw-r--r--sql/vtmd.cc2
4 files changed, 4 insertions, 4 deletions
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index cf890f316bc..0fd6fe92d1f 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -23,7 +23,7 @@
#include "sp_head.h"
static mysql_mutex_t Cversion_lock;
-static ulong volatile Cversion= 0;
+static ulong volatile Cversion= 1;
/*
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 4afecb67ec9..4c05c5cb98d 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3161,7 +3161,7 @@ bool Sql_cmd_call::execute(THD *thd)
if (do_execute_sp(thd, sp))
return true;
- if (sp->sp_cache_version() == ULONG_MAX)
+ if (sp->sp_cache_version() == 0)
{
sp_cache_flush(thd->sp_proc_cache, sp);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b48006aeed1..4fadafd164d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1079,7 +1079,7 @@ int SELECT_LEX::vers_setup_conds(THD *thd, TABLE_LIST *tables, COND **where_expr
if (thd->spcont)
{
DBUG_ASSERT(thd->spcont->m_sp);
- thd->spcont->m_sp->set_sp_cache_version(ULONG_MAX);
+ thd->spcont->m_sp->set_sp_cache_version(0);
}
}
diff --git a/sql/vtmd.cc b/sql/vtmd.cc
index ebab4bc4c92..383525255c0 100644
--- a/sql/vtmd.cc
+++ b/sql/vtmd.cc
@@ -689,7 +689,7 @@ bool VTMD_table::setup_select(THD* thd)
if (thd->spcont)
{
DBUG_ASSERT(thd->spcont->m_sp);
- thd->spcont->m_sp->set_sp_cache_version(ULONG_MAX);
+ thd->spcont->m_sp->set_sp_cache_version(0);
}
return false;
}