List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:June 1 2011 2:14pm
Subject:Re: possible bug for EXPLAIN UPDATE/DELETE
View as plain text  
Hello Guilhem!

Thanks a lot! Adding...

Gleb.

On 06/01/2011 06:10 PM, Guilhem Bichot wrote:
> Hello Gleb,
>
> There is this code which can be executed by EXPLAIN SELECT: in
> open_and_lock_tables():
>
>   if (derived)
>   {
>     if (mysql_handle_derived(thd->lex, &mysql_derived_prepare))
>       goto err;
>     if (thd->fill_derived_tables() &&
>         mysql_handle_derived(thd->lex, &mysql_derived_filling))
>     {
>       mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
>       goto err;
>     }
>     if (!(thd->lex->describe))
>       mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
>
> see: if EXPLAIN, we don't call mysql_derived_cleanup() at this stage, because we need
> structures to live until we can explain them.
>
> There are in sql_update.cc some _unconditional_ calls:
>   mysql_handle_derived(thd->lex, &mysql_derived_cleanup);
> which, I suspect, might crash with EXPLAIN UPDATE or EXPLAIN multi-table UPDATE if a
> derived table is used (in the FROM).
>
> Could you please check, add some MTR tests?
>
> Thanks!
>

Thread
possible bug for EXPLAIN UPDATE/DELETEGuilhem Bichot1 Jun
  • Re: possible bug for EXPLAIN UPDATE/DELETEGleb Shchepa1 Jun