summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_acl.cc6
-rw-r--r--sql/sql_show.cc4
2 files changed, 6 insertions, 4 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 2d7f62cd725..376dad2373e 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -54,6 +54,7 @@
#include "sql_array.h"
#include "sql_hset.h"
#include "password.h"
+#include "scope.h"
#include "sql_plugin_compat.h"
@@ -2465,10 +2466,11 @@ static bool acl_load(THD *thd, const Grant_tables& tables)
READ_RECORD read_record_info;
bool check_no_resolve= specialflag & SPECIAL_NO_RESOLVE;
char tmp_name[SAFE_NAME_LEN+1];
- Sql_mode_save old_mode_save(thd);
DBUG_ENTER("acl_load");
- thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH;
+ auto _= make_scope_value(thd->variables.sql_mode,
+ thd->variables.sql_mode &
+ ~MODE_PAD_CHAR_TO_FULL_LENGTH);
grant_version++; /* Privileges updated */
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)
{