diff options
author | Sergei Golubchik <serg@mariadb.org> | 2019-03-15 20:00:28 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-03-15 21:00:41 +0100 |
commit | 0508d327aef520d3131ff8a85ed610337149fffc (patch) | |
tree | 7e04769f49b4aded9053adcad442fe00eb487d98 /sql/sql_class.cc | |
parent | bb8c82c66abddf796e8d44f817518e5ab38ae6e4 (diff) | |
parent | 34db9958e28c325b0f708f78b7ff029de810d5ea (diff) | |
download | mariadb-git-0508d327aef520d3131ff8a85ed610337149fffc.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 6592dcd8f6f..d6aa6456710 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2370,18 +2370,28 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, long key_length) } -int THD::send_explain_fields(select_result *result, uint8 explain_flags, bool is_analyze) +int THD::prepare_explain_fields(select_result *result, List<Item> *field_list, + uint8 explain_flags, bool is_analyze) { - List<Item> field_list; if (lex->explain_json) - make_explain_json_field_list(field_list, is_analyze); + make_explain_json_field_list(*field_list, is_analyze); else - make_explain_field_list(field_list, explain_flags, is_analyze); + make_explain_field_list(*field_list, explain_flags, is_analyze); + + return result->prepare(*field_list, NULL); +} - result->prepare(field_list, NULL); - return (result->send_result_set_metadata(field_list, - Protocol::SEND_NUM_ROWS | - Protocol::SEND_EOF)); + +int THD::send_explain_fields(select_result *result, + uint8 explain_flags, + bool is_analyze) +{ + List<Item> field_list; + int rc; + rc= prepare_explain_fields(result, &field_list, explain_flags, is_analyze) || + result->send_result_set_metadata(field_list, Protocol::SEND_NUM_ROWS | + Protocol::SEND_EOF); + return rc; } @@ -2456,7 +2466,7 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags, if (is_analyze) { field_list.push_back(item= new (mem_root) - Item_float(this, "r_rows", 0.1234, 10, 4), + Item_float(this, "r_rows", 0.1234, 2, 4), mem_root); item->maybe_null=1; } |