revision-id: 6cb2ab53284a64e0f2aba48f458cd4a6028a4639 (mariadb-10.3.6-108-g6cb2ab53284) parent(s): 9e114455a95c15cd1e37dabef0dff1fe2588d50a author: Galina Shalygina committer: Galina Shalygina timestamp: 2019-02-07 13:22:07 +0300 message: MDEV-18144 ANALYZE fixes Fix bugs caused by changes for ANALYZE --- sql/sql_explain.cc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index fbec10387d8..0e7f8f377aa 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -392,11 +392,19 @@ int print_explain_row(select_result_sink *result, item_list.push_back(item_null, mem_root); /* 'r_rows' */ + StringBuffer<64> r_rows_str; if (is_analyze) { if (r_rows) - item_list.push_back(new (mem_root) Item_float(thd, *r_rows, 2), - mem_root); + { + Item_float *fl= new (mem_root) Item_float(thd, *r_rows, 2); + String tmp; + String *res= fl->val_str(&tmp); + r_rows_str.append(res->ptr()); + item_list.push_back(new (mem_root) + Item_string_sys(thd, r_rows_str.ptr(), + r_rows_str.length()), mem_root); + } else item_list.push_back(item_null, mem_root); } @@ -529,10 +537,17 @@ int Explain_union::print_explain(Explain_query *query, item_list.push_back(item_null, mem_root); /* `r_rows` */ + StringBuffer<64> r_rows_str; if (is_analyze) { double avg_rows= fake_select_lex_tracker.get_avg_rows(); - item_list.push_back(new (mem_root) Item_float(thd, avg_rows, 2), mem_root); + Item_float *fl= new (mem_root) Item_float(thd, avg_rows, 2); + String tmp; + String *res= fl->val_str(&tmp); + r_rows_str.append(res->ptr()); + item_list.push_back(new (mem_root) + Item_string_sys(thd, r_rows_str.ptr(), + r_rows_str.length()), mem_root); } /* `filtered` */