MCPcopy Create free account
hub / github.com/MariaDB/server / call_in_target_thread

Method call_in_target_thread

sql/sql_show.cc:3179–3213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3177*/
3178
3179void Show_explain_request::call_in_target_thread()
3180{
3181 Query_arena backup_arena;
3182 bool printed_anything= FALSE;
3183
3184 /*
3185 Change the arena because JOIN::print_explain and co. are going to allocate
3186 items. Let them allocate them on our arena.
3187 */
3188 target_thd->set_n_backup_active_arena((Query_arena*)request_thd,
3189 &backup_arena);
3190
3191 query_str.copy(target_thd->query(),
3192 target_thd->query_length(),
3193 target_thd->query_charset());
3194
3195 DBUG_ASSERT(current_thd == target_thd);
3196
3197 /*
3198 When producing JSON output, one should not change current_thd.
3199 (If one does that, they will hit an assert when printing constant item
3200 fields).
3201 */
3202 if (target_thd->lex->print_explain(explain_buf, 0 /* explain flags*/,
3203 is_analyze, is_json_format,
3204 &printed_anything))
3205 {
3206 failed_to_produce= TRUE;
3207 }
3208
3209 if (!printed_anything)
3210 failed_to_produce= TRUE;
3211
3212 target_thd->restore_active_arena((Query_arena*)request_thd, &backup_arena);
3213}
3214
3215
3216int select_result_explain_buffer::send_data(List<Item> &items)

Callers 1

process_apc_requestsMethod · 0.45

Calls 7

query_lengthMethod · 0.80
query_charsetMethod · 0.80
restore_active_arenaMethod · 0.80
copyMethod · 0.45
queryMethod · 0.45
print_explainMethod · 0.45

Tested by

no test coverage detected