diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-04 18:19:47 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-05-04 18:19:47 +0200 |
commit | ba0433dc1ccbbf2a92ac40fc3e34339a822938f2 (patch) | |
tree | f3283da1b844bc26efdd9e754332afe4c0f638d5 /sql/table.cc | |
parent | 749c512911d36fbecc506b72694c473fcc8c2fd4 (diff) | |
parent | 7973ffde0fede83049a1d611c379b9ee61dea9c9 (diff) | |
download | mariadb-git-ba0433dc1ccbbf2a92ac40fc3e34339a822938f2.tar.gz |
Merge branch '10.4' into 10.5
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/table.cc b/sql/table.cc index eaf337c3911..a25f279db08 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -9377,8 +9377,13 @@ void TABLE_LIST::wrap_into_nested_join(List<TABLE_LIST> &join_list) static inline bool derived_table_optimization_done(TABLE_LIST *table) { - return table->derived && - (table->derived->is_excluded() || + SELECT_LEX_UNIT *derived= (table->derived ? + table->derived : + (table->view ? + &table->view->unit: + NULL)); + return derived && + (derived->is_excluded() || table->is_materialized_derived()); } @@ -9440,8 +9445,7 @@ bool TABLE_LIST::init_derived(THD *thd, bool init_view) set_derived(); } - if (is_view() || - !derived_table_optimization_done(this)) + if (!derived_table_optimization_done(this)) { /* A subquery might be forced to be materialized due to a side-effect. */ if (!is_materialized_derived() && unit->can_be_merged() && |