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.cc19
1 files changed, 8 insertions, 11 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 4e6354d9af4..7c3cec38601 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
- Copyright (c) 2008-2011 Monty Program Ab
+/* Copyright (c) 2002, 2013, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2011, 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
@@ -255,17 +255,14 @@ uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
return session_value_ptr(thd, base);
}
-bool sys_var::set_default(THD *thd, enum_var_type type)
+bool sys_var::set_default(THD *thd, set_var* var)
{
- LEX_STRING empty={0,0};
- set_var var(type, 0, &empty, 0);
-
- if (type == OPT_GLOBAL || scope() == GLOBAL)
- global_save_default(thd, &var);
+ if (var->type == OPT_GLOBAL || scope() == GLOBAL)
+ global_save_default(thd, var);
else
- session_save_default(thd, &var);
+ session_save_default(thd, var);
- return check(thd, &var) || update(thd, &var);
+ return check(thd, var) || update(thd, var);
}
void sys_var::do_deprecated_warning(THD *thd)
@@ -667,7 +664,7 @@ int set_var::light_check(THD *thd)
*/
int set_var::update(THD *thd)
{
- return value ? var->update(thd, this) : var->set_default(thd, type);
+ return value ? var->update(thd, this) : var->set_default(thd, this);
}