| 17027 | */ |
| 17028 | |
| 17029 | bool JOIN_TAB::preread_init() |
| 17030 | { |
| 17031 | TABLE_LIST *derived= table->pos_in_table_list; |
| 17032 | DBUG_ENTER("JOIN_TAB::preread_init"); |
| 17033 | |
| 17034 | if (!derived || !derived->is_materialized_derived()) |
| 17035 | { |
| 17036 | preread_init_done= TRUE; |
| 17037 | DBUG_RETURN(FALSE); |
| 17038 | } |
| 17039 | |
| 17040 | /* Materialize derived table/view. */ |
| 17041 | if ((!derived->get_unit()->executed || |
| 17042 | derived->is_recursive_with_table() || |
| 17043 | derived->get_unit()->uncacheable) && |
| 17044 | mysql_handle_single_derived(join->thd->lex, |
| 17045 | derived, DT_CREATE | DT_FILL)) |
| 17046 | DBUG_RETURN(TRUE); |
| 17047 | |
| 17048 | if (!(derived->get_unit()->uncacheable & UNCACHEABLE_DEPENDENT) || |
| 17049 | derived->is_nonrecursive_derived_with_rec_ref() || |
| 17050 | is_split_derived) |
| 17051 | preread_init_done= TRUE; |
| 17052 | if (select && select->quick) |
| 17053 | select->quick->replace_handler(table->file); |
| 17054 | |
| 17055 | DBUG_EXECUTE_IF("show_explain_probe_join_tab_preread", |
| 17056 | if (dbug_user_var_equals_int(join->thd, |
| 17057 | "show_explain_probe_select_id", |
| 17058 | join->select_lex->select_number)) |
| 17059 | dbug_serve_apcs(join->thd, 1); |
| 17060 | ); |
| 17061 | |
| 17062 | /* init ftfuns for just initialized derived table */ |
| 17063 | if (table->fulltext_searched) |
| 17064 | if (init_ftfuncs(join->thd, join->select_lex, MY_TEST(join->order))) |
| 17065 | DBUG_RETURN(TRUE); |
| 17066 | |
| 17067 | DBUG_RETURN(FALSE); |
| 17068 | } |
| 17069 | |
| 17070 | |
| 17071 | /** |
no test coverage detected