← Back to team overview

maria-developers team mailing list archive

review: [Commits] Rev 3045: Fix gcc 4.6 warning after merge with 5.1 in file:///home/bell/maria/bzr/work-maria-5.2-merge/

 

Hi!

Review follows:

>   Fix gcc 4.6 warning after merge with 5.1

> === modified file 'sql/table.cc'
> --- a/sql/table.cc	2011-09-01 18:18:29 +0000
> +++ b/sql/table.cc	2011-10-27 16:18:25 +0000
> @@ -5484,7 +5484,7 @@ int update_virtual_fields(THD *thd, TABL
>  {
>    DBUG_ENTER("update_virtual_fields");
>    Field **vfield_ptr, *vfield;
> -  int error= 0;
> +  int error __attribute__ ((unused))= 0;
>    if (!table || !table->vfield)
>      DBUG_RETURN(0);

The above is wrong.
The bug is that we ignore the value of error later down:

 error= vfield->vcol_info->expr_item->save_in_field(vfield, 0);

We should change the above code to be:

if (!ignore_errors && error < 0)
{
  my_printf_error(ER_UNKNOWN_ERROR, "Got error when computing value
for virtual column %s", vfield->field_name, MYF(0));
  DBUG_RETURN(1);
}

We also need to add 'ignore_errors' as a parameter and add the new
parameter to the calls. This can for now be '0' for all cases except
for the cases where we check the value for the function, like in
fill_record where we already handle the ignore_errors variable.

Regards,
Monty