summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 4e72f117869..c443364ce52 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -294,6 +294,12 @@ String *Item_func_concat::val_str(String *str)
{
if (!(res=args[i]->val_str(str)))
goto null;
+ /*
+ CONCAT accumulates its result in the result of its the first
+ non-empty argument. Because of this we need is_const to be
+ evaluated only for it.
+ */
+ is_const= args[i]->const_item() || !args[i]->used_tables();
}
else
{