summaryrefslogtreecommitdiff
path: root/sql/sql_explain.cc
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2019-02-07 13:22:07 +0300
committerGalina Shalygina <galina.shalygina@mariadb.com>2019-02-07 13:22:07 +0300
commit6cb2ab53284a64e0f2aba48f458cd4a6028a4639 (patch)
tree6b50dfcbea6dd8e4d9c9c3645c216d0a6daf0c1d /sql/sql_explain.cc
parent9e114455a95c15cd1e37dabef0dff1fe2588d50a (diff)
downloadmariadb-git-6cb2ab53284a64e0f2aba48f458cd4a6028a4639.tar.gz
MDEV-18144 ANALYZE fixes
Fix bugs caused by changes for ANALYZE
Diffstat (limited to 'sql/sql_explain.cc')
-rw-r--r--sql/sql_explain.cc21
1 files 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` */