From 08c05b5f34f7b301ba669a88df3b038f0c34d379 Mon Sep 17 00:00:00 2001 From: Varun Gupta Date: Tue, 29 Jan 2019 14:18:35 +0200 Subject: MDEV-15744: Assertion `derived->table' failed in mysql_derived_merge_for_insert For singe-table views, we need to find the bottom most base table in the embedded views and then update that table --- sql/sql_load.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 5029efa7d68..27c0938c9a0 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -233,8 +233,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, if (open_and_lock_tables(thd, table_list, TRUE, 0)) DBUG_RETURN(TRUE); - if (mysql_handle_single_derived(thd->lex, table_list, DT_MERGE_FOR_INSERT) || - mysql_handle_single_derived(thd->lex, table_list, DT_PREPARE)) + if (table_list->handle_derived(thd->lex, DT_MERGE_FOR_INSERT)) + DBUG_RETURN(TRUE); + if (mysql_handle_list_of_derived(thd->lex, table_list, DT_PREPARE)) DBUG_RETURN(TRUE); if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context, &thd->lex->select_lex.top_join_list, -- cgit v1.2.1