summaryrefslogtreecommitdiff
path: root/sql/sql_explain.h
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-06-03 19:04:59 +0400
committerSergei Petrunia <psergey@askmonty.org>2014-06-03 19:04:59 +0400
commit917b22393f16a2143fd0e480473123731be5b6d1 (patch)
tree92da89508eb96725cc74942804acd12b8df9fc54 /sql/sql_explain.h
parent5621aa3230a60c97111f52c03dc31ce7b57d70d6 (diff)
downloadmariadb-git-917b22393f16a2143fd0e480473123731be5b6d1.tar.gz
MDEV-406: ANALYZE $stmt
- Testcase for ANALYZE UNION - Provide r_rows for union result.
Diffstat (limited to 'sql/sql_explain.h')
-rw-r--r--sql/sql_explain.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index 7970d778a21..203235f9f5c 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -27,6 +27,11 @@ public:
ha_rows r_rows; /* How many rows we've got after that */
ha_rows r_rows_after_table_cond; /* Rows after applying the table condition */
ha_rows r_rows_after_where; /* Rows after applying attached part of WHERE */
+
+ ha_rows get_avg_rows()
+ {
+ return r_scans ? round((double) r_rows / r_scans): 0;
+ }
};