Hi Barkov,
Patch approved, a minor comment below.
bar@stripped wrote:
[..]
> --- a/sql/item_strfunc.cc 2008-02-22 15:05:07 +04:00
> +++ b/sql/item_strfunc.cc 2008-03-17 16:12:08 +04:00
> @@ -2979,9 +2979,9 @@ String *Item_func_weight_string::val_str
> uint tmp_length, frm_length;
> DBUG_ASSERT(fixed == 1);
>
> - if (args[0]->null_value ||
> - args[0]->result_type() != STRING_RESULT ||
> - !(res= args[0]->val_str(str)))
> + if (args[0]->result_type() != STRING_RESULT ||
> + !(res= args[0]->val_str(str)) ||
> + args[0]->null_value)
> goto nl;
Use args[0]->is_null() instead of ->null_value as on the original
expression or drop the null check. The code below definitely can't run
if res is NULL.
Regards,
--
Davi Arnaut, Software Engineer
MySQL Inc, www.mysql.com
Are you MySQL certified? www.mysql.com/certification