summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorEugene Kosov <eugene.kosov@mariadb.com>2020-06-18 17:26:01 +0300
committerEugene Kosov <claprix@yandex.ru>2022-01-16 22:56:02 +0300
commit24a79f0d707f1be7452c80fca7f71d29deac83fb (patch)
treee14c0759c7f0e2cd61941a1d0eeb3caf3f472790 /sql/sql_show.cc
parent347f6d01e3b570dce49aa1ab42cb83021905a14d (diff)
downloadmariadb-git-bb-10.8-MDEV-22441-scoped-variable.tar.gz
MDEV-22441 implement a generic way to change a value of a variable in a scopebb-10.8-MDEV-22441-scoped-variable
Example: { auto _= make_scope_value(var, tmp_value); } make_scope_value(): a function which returns RAII object which temporary changes a value of a variable detail::Scope_value: actual implementation of such RAII class. It shouldn't be used directly! That's why it's inside a namespace detail.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index d01f84fe7d1..2851f867889 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -65,6 +65,7 @@
#include "transaction.h"
#include "opt_trace.h"
#include "my_cpu.h"
+#include "scope.h"
#include "lex_symbol.h"
@@ -6409,8 +6410,7 @@ bool store_schema_params(THD *thd, TABLE *table, TABLE *proc_table,
{
Field *field;
LEX_CSTRING tmp_string;
- Sql_mode_save sql_mode_backup(thd);
- thd->variables.sql_mode= sql_mode;
+ auto _= make_scope_value(thd->variables.sql_mode, sql_mode);
if (sph->type() == SP_TYPE_FUNCTION)
{