summaryrefslogtreecommitdiff
path: root/sql/sql_derived.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-08-16 19:18:39 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2017-08-16 19:18:39 +0200
commitbcc1ba921829dc8b09bcbfbc5e5a916d6f1d2ca0 (patch)
tree23c22e1657911cd13199217f3357450b74ee0499 /sql/sql_derived.cc
parente866e4cdbe974a83d4a4ee474d28f61e7082700f (diff)
downloadmariadb-git-bcc1ba921829dc8b09bcbfbc5e5a916d6f1d2ca0.tar.gz
MDEV-11240: Server crashes in check_view_single_update or Assertion `derived->table' failed in mysql_derived_merge_for_insert
Before "merge" view shoud be inited to maintaing transitive attributes like "multitable".
Diffstat (limited to 'sql/sql_derived.cc')
-rw-r--r--sql/sql_derived.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 493f0eccc8c..6cd4547aaf9 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -510,6 +510,8 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
DBUG_ENTER("mysql_derived_merge_for_insert");
if (derived->merged_for_insert)
DBUG_RETURN(FALSE);
+ if (derived->init_derived(thd, FALSE))
+ DBUG_RETURN(TRUE);
if (derived->is_materialized_derived())
DBUG_RETURN(mysql_derived_prepare(thd, lex, derived));
if ((thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
@@ -526,8 +528,6 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
derived->merged_for_insert= TRUE;
}
}
- else
- derived->table= derived->merge_underlying_list->table;
DBUG_RETURN(FALSE);
}