summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <elliot@mysql.com>2005-06-17 11:15:29 -0400
committerunknown <elliot@mysql.com>2005-06-17 11:15:29 -0400
commit98ff15531f2c6d4d84c7ed5bac563182625c3eb4 (patch)
treedd9af158607f9b68e38ee6cdc06831e0d729139d /sql/sql_parse.cc
parent6de6d3ad5cc34a53735b0b12ca80846d50537f62 (diff)
downloadmariadb-git-98ff15531f2c6d4d84c7ed5bac563182625c3eb4.tar.gz
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.
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index c107203b548..81fcc30dd08 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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.