diff options
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r-- | sql/sql_join_cache.cc | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index e952cf3e2ef..44b953a27fb 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -2491,8 +2491,36 @@ void JOIN_CACHE::print_explain_comment(String *str) str->append(join_alg); str->append(STRING_WITH_LEN(" join")); str->append(STRING_WITH_LEN(")")); - } - +} + + +static void add_mrr_explain_info(String *str, uint mrr_mode, handler *file) +{ + char mrr_str_buf[128]={0}; + int len; + len= file->multi_range_read_explain_info(mrr_mode, mrr_str_buf, + sizeof(mrr_str_buf)); + if (len > 0) + { + str->append(STRING_WITH_LEN("; ")); + str->append(mrr_str_buf, len); + } +} + + +void JOIN_CACHE_BKA::print_explain_comment(String *str) +{ + JOIN_CACHE::print_explain_comment(str); + add_mrr_explain_info(str, mrr_mode, join_tab->table->file); +} + + +void JOIN_CACHE_BKAH::print_explain_comment(String *str) +{ + JOIN_CACHE::print_explain_comment(str); + add_mrr_explain_info(str, mrr_mode, join_tab->table->file); +} + /* Initialize a hashed join cache |