summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2004-10-29 16:06:51 +0500
committerunknown <bar@mysql.com>2004-10-29 16:06:51 +0500
commitfcb322279eba22dcc29093d0212ea5a21f78ed59 (patch)
tree4178bdf5f651aec6eb85b2a043d11baff4c542da /sql/item_strfunc.cc
parenta739f2d692093accfb5babf3df9008913fdf5d3f (diff)
downloadmariadb-git-fcb322279eba22dcc29093d0212ea5a21f78ed59.tar.gz
item_strfunc.cc:
Unnecessary code was removed. sql/item_strfunc.cc: Unnecessary code was removed.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index c51894afde4..2d9f7e7bff8 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -643,7 +643,12 @@ void Item_func_concat_ws::fix_length_and_dec()
if (agg_arg_collations(collation, args, arg_count))
return;
- max_length= arg_count > 1 ? args[0]->max_length * (arg_count - 2) : 0;
+ /*
+ arg_count cannot be less than 2,
+ it is done on parser level in sql_yacc.yy
+ so, (arg_count - 2) is safe here.
+ */
+ max_length= args[0]->max_length * (arg_count - 2);
for (uint i=1 ; i < arg_count ; i++)
max_length+=args[i]->max_length;