← Back to team overview

maria-developers team mailing list archive

Re: 2b527a4e858: MDEV-17729: Assertion `! is_set() || m_can_overwrite_status' failed in

 

Hi, Rucha!

On Jul 30, Rucha Deodhar wrote:
> revision-id: 2b527a4e858 (mariadb-10.1.43-218-g2b527a4e858)
> parent(s): 57ec42bc321
> author: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> committer: Rucha Deodhar <rucha.deodhar@xxxxxxxxxxx>
> timestamp: 2020-07-27 09:50:00 +0530
> message:
> 
> MDEV-17729: Assertion `! is_set() || m_can_overwrite_status' failed in
> Diagnostics_area::set_error_status
> 
> Analysis: When strict mode is enabled, all warnings are converted to errors
> even when there is no bad data and the query is already killed.
> Fix: If the query is already killed because examined rows exceeded the limit,
> the warning is not because of bad data and should not be converted to error.
> 
> diff --git a/sql/sql_class.cc b/sql/sql_class.cc
> index 6897a26bda1..3591695a22d 100644
> --- a/sql/sql_class.cc
> +++ b/sql/sql_class.cc
> @@ -1156,13 +1156,17 @@ Sql_condition* THD::raise_condition(uint sql_errno,
>    if (sqlstate == NULL)
>     sqlstate= mysql_errno_to_sqlstate(sql_errno);
>  
> -  if ((level == Sql_condition::WARN_LEVEL_WARN) &&
> -      really_abort_on_warning())
> +  if ((killed == NOT_KILLED) && (level == Sql_condition::WARN_LEVEL_WARN) &&
> +       really_abort_on_warning())

I don't understand this. I presume the assert that fails is in
da->set_error_status(), called below as

    if (!da->is_error())
    {
      set_row_count_func(-1);
      da->set_error_status(sql_errno, msg, sqlstate, cond);
    }

but if(!da->is_error()) should prevent set_error_status() from being
called when it would need to overwrite the status. So how comes it is
still called and triggers the assert?

>    {
> -    /*
> -      FIXME:
> -      push_warning and strict SQL_MODE case.
> -    */
>      level= Sql_condition::WARN_LEVEL_ERROR;
>      set_killed(KILL_BAD_DATA);
>    }

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