summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_explain.cc2
-rw-r--r--sql/sql_select.cc41
2 files changed, 17 insertions, 26 deletions
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index 75f6689ab98..0f4fd7eea82 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -508,7 +508,7 @@ int Explain_table_access::print_explain(select_result_sink *output, uint8 explai
/* `rows` */
if (rows_set)
{
- item_list.push_back(new Item_int((longlong) (ulonglong) rows,
+ item_list.push_back(new Item_int((ulonglong) rows,
MY_INT64_NUM_DECIMAL_DIGITS));
}
else
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;