diff options
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/table.cc b/sql/table.cc index 9cb33e92d89..90cdc7089b9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -19,7 +19,6 @@ #include <my_global.h> /* NO_EMBEDDED_ACCESS_CHECKS */ #include "sql_priv.h" -#include "unireg.h" // REQUIRED: for other includes #include "table.h" #include "key.h" // find_ref_key #include "sql_table.h" // build_table_filename, @@ -5338,6 +5337,12 @@ Item *create_view_field(THD *thd, TABLE_LIST *view, Item **field_ref, item->maybe_null= TRUE; /* Save item in case we will need to fall back to materialization. */ view->used_items.push_front(item); + /* + If we create this reference on persistent memory then it should be + present in persistent list + */ + if (thd->mem_root == thd->stmt_arena->mem_root) + view->persistent_used_items.push_front(item); DBUG_RETURN(item); } @@ -6915,6 +6920,7 @@ bool TABLE_LIST::handle_derived(LEX *lex, uint phases) { SELECT_LEX_UNIT *unit; DBUG_ENTER("handle_derived"); + DBUG_PRINT("enter", ("phases: 0x%x", phases)); if ((unit= get_unit())) { for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select()) |