summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorevgen@moonbone.local <>2006-06-15 14:57:53 +0400
committerevgen@moonbone.local <>2006-06-15 14:57:53 +0400
commitb6698528665f0e1995fa7b4f253ae85527b09e79 (patch)
tree539c6177d83a2321e8a167cb3f4f33c5898b825e /sql/item_strfunc.cc
parent766b4a8c7ff930d8d1b3a9b361c40984b5469b06 (diff)
parentc9077f07e708f55ec4241fdb62ebd271707cb824 (diff)
downloadmariadb-git-b6698528665f0e1995fa7b4f253ae85527b09e79.tar.gz
Merge moonbone.local:/work/15351-bug-4.1-mysql
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index e817edac6c0..deb3542f4a5 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -268,11 +268,13 @@ String *Item_func_concat::val_str(String *str)
DBUG_ASSERT(fixed == 1);
String *res,*res2,*use_as_buff;
uint i;
+ bool is_const= 0;
null_value=0;
if (!(res=args[0]->val_str(str)))
goto null;
use_as_buff= &tmp_value;
+ is_const= args[0]->const_item();
for (i=1 ; i < arg_count ; i++)
{
if (res->length() == 0)
@@ -295,7 +297,7 @@ String *Item_func_concat::val_str(String *str)
current_thd->variables.max_allowed_packet);
goto null;
}
- if (res->alloced_length() >= res->length()+res2->length())
+ if (!is_const && res->alloced_length() >= res->length()+res2->length())
{ // Use old buffer
res->append(*res2);
}
@@ -350,6 +352,7 @@ String *Item_func_concat::val_str(String *str)
res= &tmp_value;
use_as_buff=str;
}
+ is_const= 0;
}
}
res->set_charset(collation.collation);