summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-08-25 18:36:59 +0200
committerSergei Golubchik <serg@mariadb.org>2019-08-26 00:13:15 +0200
commit4f321289af20427d59aa7c46daa3597122a5eca2 (patch)
treeabd05a119a4ceaec2feb5e170082fc7d31a6eac1 /sql/sql_select.cc
parent9db31471641071bcc8f74a6a22b2a3845c830e3d (diff)
downloadmariadb-git-bb-10.0-release.tar.gz
fix EXPLAIN outputbb-10.0-release
1. avoid ha_rows->double->ha_rows cast, for ~0ULL it behaves differently on Linux and Windows. This fixes the differences in derived_view and mdev13607 results between Linux and Windows. 2. EXPLAIN should show the number of rows as an unsigned number.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc41
1 files changed, 16 insertions, 25 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index d366e43244f..a472bcf2bde 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -11615,12 +11615,11 @@ double JOIN_TAB::scan_time()
ha_rows JOIN_TAB::get_examined_rows()
{
- double examined_rows;
-
if (select && select->quick && use_quick != 2)
- examined_rows= select->quick->records;
- else if (type == JT_NEXT || type == JT_ALL ||
- type == JT_HASH || type ==JT_HASH_NEXT)
+ return select->quick->records;
+
+ if (type == JT_NEXT || type == JT_ALL ||
+ type == JT_HASH || type ==JT_HASH_NEXT)
{
if (limit)
{
@@ -11628,26 +11627,20 @@ ha_rows JOIN_TAB::get_examined_rows()
@todo This estimate is wrong, a LIMIT query may examine much more rows
than the LIMIT itself.
*/
- examined_rows= limit;
- }
- else
- {
- if (table->is_filled_at_execution())
- examined_rows= records;
- else
- {
- /*
- handler->info(HA_STATUS_VARIABLE) has been called in
- make_join_statistics()
- */
- examined_rows= table->stat_records();
- }
+ return limit;
}
+
+ if (table->is_filled_at_execution())
+ return records;
+
+ /*
+ handler->info(HA_STATUS_VARIABLE) has been called in
+ make_join_statistics()
+ */
+ return table->stat_records();
}
- else
- examined_rows= records_read;
- return (ha_rows) examined_rows;
+ return (ha_rows) records_read;
}
@@ -24023,10 +24016,8 @@ int JOIN::save_explain_data_intern(Explain_query *output, bool need_tmp_table,
}
else
{
- double examined_rows= tab->get_examined_rows();
-
+ double examined_rows= eta->rows= tab->get_examined_rows();
eta->rows_set= true;
- eta->rows= (ha_rows) examined_rows;
/* "filtered" */
float f= 0.0;