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_derived.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_derived.cc')
-rw-r--r-- | sql/sql_derived.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index 004cccb41a9..56748fa110d 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -507,6 +507,9 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived) DBUG_RETURN(FALSE); if (derived->is_materialized_derived()) DBUG_RETURN(mysql_derived_prepare(thd, lex, derived)); + if ((thd->lex->sql_command == SQLCOM_UPDATE_MULTI || + thd->lex->sql_command == SQLCOM_DELETE_MULTI)) + DBUG_RETURN(FALSE); if (!derived->is_multitable()) { if (!derived->single_table_updatable()) |