| 103 | |
| 104 | |
| 105 | bool Update_plan::save_explain_data_intern(THD *thd, |
| 106 | MEM_ROOT *mem_root, |
| 107 | Explain_update *explain, |
| 108 | bool is_analyze) |
| 109 | { |
| 110 | explain->select_type= "SIMPLE"; |
| 111 | explain->table_name.append(table->alias); |
| 112 | |
| 113 | explain->impossible_where= false; |
| 114 | explain->no_partitions= false; |
| 115 | |
| 116 | if (impossible_where) |
| 117 | { |
| 118 | explain->impossible_where= true; |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | if (no_partitions) |
| 123 | { |
| 124 | explain->no_partitions= true; |
| 125 | return 0; |
| 126 | } |
| 127 | |
| 128 | if (is_analyze || |
| 129 | (thd->variables.log_slow_verbosity & |
| 130 | LOG_SLOW_VERBOSITY_ENGINE)) |
| 131 | { |
| 132 | explain->table_tracker.set_gap_tracker(&explain->extra_time_tracker); |
| 133 | table->file->set_time_tracker(&explain->table_tracker); |
| 134 | |
| 135 | if (table->file->handler_stats && table->s->tmp_table != INTERNAL_TMP_TABLE) |
| 136 | explain->handler_for_stats= table->file; |
| 137 | } |
| 138 | |
| 139 | select_lex->set_explain_type(TRUE); |
| 140 | explain->select_type= select_lex->type; |
| 141 | /* Partitions */ |
| 142 | { |
| 143 | #ifdef WITH_PARTITION_STORAGE_ENGINE |
| 144 | partition_info *part_info; |
| 145 | if ((part_info= table->part_info)) |
| 146 | { |
| 147 | make_used_partitions_str(mem_root, part_info, &explain->used_partitions, |
| 148 | explain->used_partitions_list); |
| 149 | explain->used_partitions_set= true; |
| 150 | } |
| 151 | else |
| 152 | explain->used_partitions_set= false; |
| 153 | #else |
| 154 | /* just produce empty column if partitioning is not compiled in */ |
| 155 | explain->used_partitions_set= false; |
| 156 | #endif |
| 157 | } |
| 158 | |
| 159 | |
| 160 | /* Set jtype */ |
| 161 | if (select && select->quick) |
| 162 | { |
nothing calls this directly
no test coverage detected