← Back to team overview

maria-developers team mailing list archive

Re: MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END

 

Hi, Alexander!

> commit 2a39621c1343f4c29c69647d151441d171fb3e7b
> Author: Alexander Barkov <bar@xxxxxxxxxxx>
> Date:   Tue Apr 19 16:56:41 2016 +0400
> 
>     MDEV-9745 Crash with CASE WHEN TRUE THEN COALESCE(CAST(NULL AS UNSIGNED)) ELSE 4 END

Please, explain the fix in this commit comment.

And see a minor suggestion below.

Otherwise - ok to push

> diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
> index 81688f3..08281c5 100644
> --- a/sql/item_cmpfunc.cc
> +++ b/sql/item_cmpfunc.cc
> @@ -3342,19 +3332,32 @@ void Item_func_coalesce::fix_length_and_dec()
>  {
>    cached_field_type= agg_field_type(args, arg_count);
>    agg_result_type(&cached_result_type, args, arg_count);
> +  fix_attributes(args, arg_count);
> +}
> +
> +
> +/**
> +  Rename this to Item_hybrid_func::fix_attributes() when mering to 10.1
> +*/

in cases like this I prefer something more robust than a comment. Like

#if MYSQL_VERSION_ID > 100100
#error Rename this to Item_hybrid_func::fix_attributes() when mering to 10.1
#endif

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


References