From c6be74458fd478b019ac357371d5aee8925fe012 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 26 Jun 2014 19:09:23 +0400 Subject: MDEV-6398: ANALYZE UPDATE does not populate r_rows - In print_explain_row(), do not forget to print r_rows. - Switch Explain_update from using its own counters to re-using Table_access_tracker. - Make ANALYZE UPDATE code structure uniform with ANALYZE DELETE. --- sql/sql_explain.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/sql_explain.cc') diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index af51c5fc382..9df4fd965a5 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -957,7 +957,8 @@ int Explain_update::print_explain(Explain_query *query, Single-table DELETE commands do not do "Using temporary". "Using index condition" is also not possible (which is an unjustified limitation) */ - double r_filtered= 100 * (r_rows?((double)r_rows_after_where/r_rows):1.0); + double r_filtered= 100 * tracker.get_filtered_after_where(); + ha_rows r_rows= tracker.get_avg_rows(); print_explain_row(output, explain_flags, is_analyze, 1, /* id */ @@ -970,7 +971,7 @@ int Explain_update::print_explain(Explain_query *query, key_len_buf.length() ? key_len_buf.c_ptr() : NULL, NULL, /* 'ref' is always NULL in single-table EXPLAIN DELETE */ &rows, - &r_rows, + tracker.has_scans()? &r_rows : NULL, r_filtered, extra_str.c_ptr_safe()); -- cgit v1.2.1