summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index c3bdb11418f..53895cc7331 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4231,14 +4231,15 @@ Item_func_get_system_var(sys_var *var_arg, enum_var_type var_type_arg,
bool
Item_func_get_system_var::fix_fields(THD *thd, Item **ref)
{
- Item *item= var->item(thd, var_type, &component);
+ Item *item;
DBUG_ENTER("Item_func_get_system_var::fix_fields");
+
/*
Evaluate the system variable and substitute the result (a basic constant)
instead of this item. If the variable can not be evaluated,
the error is reported in sys_var::item().
*/
- if (item == 0)
+ if (!(item= var->item(thd, var_type, &component)))
DBUG_RETURN(1); // Impossible
item->set_name(name, 0, system_charset_info); // don't allocate a new name
thd->change_item_tree(ref, item);