mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#10442 Fix replication slave crash when a query with multiupdate and
subselects is used. sql/sql_parse.cc: BUG#10442 Fix crash on replication slave by making sure that table list is filled out before it is used.
This commit is contained in:
@@ -1943,6 +1943,14 @@ mysql_execute_command(THD *thd)
|
||||
if (tables || &lex->select_lex != lex->all_selects_list)
|
||||
mysql_reset_errors(thd);
|
||||
|
||||
/* When subselects or time_zone info is used in a query
|
||||
* we create a new TABLE_LIST containing all referenced tables
|
||||
* and set local variable 'tables' to point to this list. */
|
||||
if ((&lex->select_lex != lex->all_selects_list ||
|
||||
lex->time_zone_tables_used) &&
|
||||
lex->unit.create_total_list(thd, lex, &tables))
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
if (thd->slave_thread)
|
||||
{
|
||||
@@ -1993,14 +2001,6 @@ mysql_execute_command(THD *thd)
|
||||
}
|
||||
#endif /* !HAVE_REPLICATION */
|
||||
|
||||
/* When subselects or time_zone info is used in a query
|
||||
* we create a new TABLE_LIST containing all referenced tables
|
||||
* and set local variable 'tables' to point to this list. */
|
||||
if ((&lex->select_lex != lex->all_selects_list ||
|
||||
lex->time_zone_tables_used) &&
|
||||
lex->unit.create_total_list(thd, lex, &tables))
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
/*
|
||||
When option readonly is set deny operations which change tables.
|
||||
Except for the replication thread and the 'super' users.
|
||||
|
||||
Reference in New Issue
Block a user