← Back to team overview

maria-developers team mailing list archive

Re: cd9cab54aac: MDEV-20015 Assertion `!in_use->is_error()' failed in TABLE::update_virtual_field

 

Hi, Aleksey!

Ok to push, thanks!

On May 26, Aleksey Midenkov wrote:
> revision-id: cd9cab54aac (mariadb-10.2.31-123-gcd9cab54aac)
> parent(s): d275ecbd208
> author: Aleksey Midenkov <midenok@xxxxxxxxx>
> committer: Aleksey Midenkov <midenok@xxxxxxxxx>
> timestamp: 2020-05-25 20:56:31 +0300
> message:
> 
> MDEV-20015 Assertion `!in_use->is_error()' failed in TABLE::update_virtual_field
> 
> update_virtual_field() is called as part of index rebuild in
> ha_myisam::repair() (MDEV-5800) which is done on bulk INSERT finish.
> 
> Assertion in update_virtual_field() was put as part of MDEV-16222
> because update_virtual_field() returns in_use->is_error(). The idea:
> wrongly mixed semantics of error status before update_virtual_field()
> and the status returned by update_virtual_field(). The former can
> falsely influence the latter.
> 
> diff --git a/sql/table.cc b/sql/table.cc
> index d6d86d96016..2429bb12abe 100644
> --- a/sql/table.cc
> +++ b/sql/table.cc
> @@ -7707,15 +7707,17 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
>  
>  int TABLE::update_virtual_field(Field *vf)
>  {
> -  DBUG_ASSERT(!in_use->is_error());
> -  Query_arena backup_arena;
>    DBUG_ENTER("TABLE::update_virtual_field");
> +  Query_arena backup_arena;
> +  Counting_error_handler count_errors;
> +  in_use->push_internal_handler(&count_errors);
>    in_use->set_n_backup_active_arena(expr_arena, &backup_arena);
>    bitmap_clear_all(&tmp_set);
>    vf->vcol_info->expr->walk(&Item::update_vcol_processor, 0, &tmp_set);
>    vf->vcol_info->expr->save_in_field(vf, 0);
>    in_use->restore_active_arena(expr_arena, &backup_arena);
> -  DBUG_RETURN(in_use->is_error());
> +  in_use->pop_internal_handler();
> +  DBUG_RETURN(count_errors.errors);
>  }

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx