Skip to content

Commit

Permalink
bugfix: mysql_create_view() infinite loop
Browse files Browse the repository at this point in the history
if mysql_create_view() is aborted when view is linked into lex
(when WSREP_TO_ISOLATION_BEGIN fails),
it should not be linked there again on err:.
  • Loading branch information
vuvova committed Jul 29, 2020
1 parent 77b7f79 commit d597077
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sql/sql_view.cc
Expand Up @@ -442,9 +442,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
if (open_temporary_tables(thd, lex->query_tables) ||
open_and_lock_tables(thd, lex->query_tables, TRUE, 0))
{
view= lex->unlink_first_table(&link_to_local);
res= TRUE;
goto err;
goto err_no_relink;
}

view= lex->unlink_first_table(&link_to_local);
Expand Down Expand Up @@ -694,10 +693,12 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,

WSREP_ERROR_LABEL:
res= TRUE;
goto err_no_relink;

err:
THD_STAGE_INFO(thd, stage_end);
lex->link_first_table_back(view, link_to_local);
err_no_relink:
unit->cleanup();
DBUG_RETURN(res || thd->is_error());
}
Expand Down

0 comments on commit d597077

Please sign in to comment.