summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-06-12 13:53:23 +0200
committerSergei Golubchik <serg@mariadb.org>2020-07-29 14:56:24 +0200
commitd5970779fac361a9ba56fccf0e9ed5b492b17d7e (patch)
tree72b770b1406826e0599d9999fde0c21d2d1877a0
parent77b7f793f9e7504b39194f530edc0e314569ea1c (diff)
downloadmariadb-git-d5970779fac361a9ba56fccf0e9ed5b492b17d7e.tar.gz
bugfix: mysql_create_view() infinite loop
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:.
-rw-r--r--sql/sql_view.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index cb92f30c932..0984372fedc 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -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);
@@ -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());
}