summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index fb691a9c095..617ce2298b1 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
- Copyright (c) 2008, 2011, Monty Program Ab
+ Copyright (c) 2008, 2013, Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -14,13 +14,9 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-#ifdef USE_PRAGMA_IMPLEMENTATION
-#pragma implementation
-#endif
-
/* variable declarations are in sys_vars.cc now !!! */
-#include "my_global.h" /* NO_EMBEDDED_ACCESS_CHECKS */
+#include "sql_plugin.h"
#include "sql_class.h" // set_var.h: session_var_ptr
#include "set_var.h"
#include "sql_priv.h"
@@ -387,7 +383,7 @@ void sys_var::do_deprecated_warning(THD *thd)
? ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT
: ER_WARN_DEPRECATED_SYNTAX;
if (thd)
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_WARN_DEPRECATED_SYNTAX, ER(errmsg),
buf1, deprecation_substitute);
else
@@ -419,12 +415,12 @@ bool throw_bounds_warning(THD *thd, const char *name,
else
llstr(v, buf);
- if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES)
+ if (thd->is_strict_mode())
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf);
return true;
}
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), name, buf);
}
@@ -439,12 +435,12 @@ bool throw_bounds_warning(THD *thd, const char *name, bool fixed, double v)
my_gcvt(v, MY_GCVT_ARG_DOUBLE, sizeof(buf) - 1, buf, NULL);
- if (thd->variables.sql_mode & MODE_STRICT_ALL_TABLES)
+ if (thd->is_strict_mode())
{
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name, buf);
return true;
}
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,
ER(ER_TRUNCATED_WRONG_VALUE), name, buf);
}
@@ -635,6 +631,7 @@ sys_var *intern_find_sys_var(const char *str, uint length)
*/
var= (sys_var*) my_hash_search(&system_variable_hash,
(uchar*) str, length ? length : strlen(str));
+
return var;
}
@@ -858,9 +855,7 @@ int set_var_password::update(THD *thd)
int set_var_role::check(THD *thd)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- ulonglong access;
- int status= acl_check_setrole(thd, base.str, &access);
- save_result.ulonglong_value= access;
+ int status= acl_check_setrole(thd, role.str, &access);
return status;
#else
return 0;
@@ -870,7 +865,7 @@ int set_var_role::check(THD *thd)
int set_var_role::update(THD *thd)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- return acl_setrole(thd, base.str, save_result.ulonglong_value);
+ return acl_setrole(thd, role.str, access);
#else
return 0;
#endif