| 264 | |
| 265 | |
| 266 | int Explain_query::print_explain_json(select_result_sink *output, |
| 267 | bool is_analyze, |
| 268 | ulonglong query_time_in_progress_ms) |
| 269 | { |
| 270 | Json_writer writer; |
| 271 | |
| 272 | #ifndef DBUG_OFF |
| 273 | DBUG_ASSERT(can_print_json); |
| 274 | #endif |
| 275 | |
| 276 | writer.start_object(); |
| 277 | |
| 278 | if (is_analyze) |
| 279 | { |
| 280 | if (query_time_in_progress_ms > 0){ |
| 281 | writer.add_member("r_query_time_in_progress_ms"). |
| 282 | add_ull(query_time_in_progress_ms); |
| 283 | } |
| 284 | |
| 285 | print_query_optimization_json(&writer); |
| 286 | } |
| 287 | |
| 288 | bool plan_found = print_query_blocks_json(&writer, is_analyze); |
| 289 | writer.end_object(); |
| 290 | |
| 291 | if( plan_found ) |
| 292 | { |
| 293 | send_explain_json_to_output(&writer, output); |
| 294 | } |
| 295 | |
| 296 | return 0; |
| 297 | } |
| 298 | |
| 299 | void Explain_query::print_query_optimization_json(Json_writer *writer) |
| 300 | { |
no test coverage detected