| 30941 | */ |
| 30942 | |
| 30943 | int print_explain_message_line(select_result_sink *result, |
| 30944 | uint8 options, bool is_analyze, |
| 30945 | uint select_number, |
| 30946 | const char *select_type, |
| 30947 | ha_rows *rows, |
| 30948 | const char *message) |
| 30949 | { |
| 30950 | /* Note: for SHOW EXPLAIN, this is caller thread's THD */ |
| 30951 | THD *thd= result->thd; |
| 30952 | MEM_ROOT *mem_root= thd->mem_root; |
| 30953 | Item *item_null= new (mem_root) Item_null(thd); |
| 30954 | List<Item> item_list; |
| 30955 | |
| 30956 | item_list.push_back(new (mem_root) Item_int(thd, (int32) select_number), |
| 30957 | mem_root); |
| 30958 | item_list.push_back(new (mem_root) Item_string_sys(thd, select_type), |
| 30959 | mem_root); |
| 30960 | /* `table` */ |
| 30961 | item_list.push_back(item_null, mem_root); |
| 30962 | |
| 30963 | /* `partitions` */ |
| 30964 | if (options & DESCRIBE_PARTITIONS) |
| 30965 | item_list.push_back(item_null, mem_root); |
| 30966 | |
| 30967 | /* type, possible_keys, key, key_len, ref */ |
| 30968 | for (uint i=0 ; i < 5; i++) |
| 30969 | item_list.push_back(item_null, mem_root); |
| 30970 | |
| 30971 | /* `rows` */ |
| 30972 | StringBuffer<64> rows_str; |
| 30973 | if (rows) |
| 30974 | { |
| 30975 | rows_str.append_ulonglong((ulonglong)(*rows)); |
| 30976 | item_list.push_back(new (mem_root) |
| 30977 | Item_string_sys(thd, rows_str.ptr(), |
| 30978 | rows_str.length()), mem_root); |
| 30979 | } |
| 30980 | else |
| 30981 | item_list.push_back(item_null, mem_root); |
| 30982 | |
| 30983 | /* `r_rows` */ |
| 30984 | if (is_analyze) |
| 30985 | item_list.push_back(item_null, mem_root); |
| 30986 | |
| 30987 | /* `filtered` */ |
| 30988 | if (is_analyze || options & DESCRIBE_EXTENDED) |
| 30989 | item_list.push_back(item_null, mem_root); |
| 30990 | |
| 30991 | /* `r_filtered` */ |
| 30992 | if (is_analyze) |
| 30993 | item_list.push_back(item_null, mem_root); |
| 30994 | |
| 30995 | /* `Extra` */ |
| 30996 | if (message) |
| 30997 | item_list.push_back(new (mem_root) Item_string_sys(thd, message), |
| 30998 | mem_root); |
| 30999 | else |
| 31000 | item_list.push_back(item_null, mem_root); |
no test coverage detected