diff options
author | unknown <sanja@askmonty.org> | 2015-02-11 01:26:50 +0100 |
---|---|---|
committer | unknown <sanja@askmonty.org> | 2015-02-11 01:26:50 +0100 |
commit | c233d6e120e20ea39dc7b9eac4cef264befc3cd0 (patch) | |
tree | f3b4f22da053dd507e6cca358e91877211d54acf /sql/sql_delete.cc | |
parent | cfb7d5d78a8aa6a683cd7a2f745d98ecfaca0100 (diff) | |
download | mariadb-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.cc | 5 |
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 |