summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2015-02-11 01:26:50 +0100
committerunknown <sanja@askmonty.org>2015-02-11 01:26:50 +0100
commitc233d6e120e20ea39dc7b9eac4cef264befc3cd0 (patch)
treef3b4f22da053dd507e6cca358e91877211d54acf /sql/sql_delete.cc
parentcfb7d5d78a8aa6a683cd7a2f745d98ecfaca0100 (diff)
downloadmariadb-git-c233d6e120e20ea39dc7b9eac4cef264befc3cd0.tar.gz
MDEV-7260: Crash in get_best_combination when executing multi-table UPDATE with nested views
Do not use merge_for_insert for commands which use SELECT because optimizer can't work with such tables. Fixes which makes multi-delete working with normally merged views.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 97d3d10c21c..055b4858598 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -657,9 +657,10 @@ multi_delete::initialize_tables(JOIN *join)
delete_while_scanning= 1;
for (walk= delete_tables; walk; walk= walk->next_local)
{
- tables_to_delete_from|= walk->table->map;
+ TABLE_LIST *tbl= walk->correspondent_table->find_table_for_update();
+ tables_to_delete_from|= tbl->table->map;
if (delete_while_scanning &&
- unique_table(thd, walk, join->tables_list, false))
+ unique_table(thd, tbl, join->tables_list, false))
{
/*
If the table we are going to delete from appears