Commit c601bb87 authored by ramil@mysql.com's avatar ramil@mysql.com

a fix (bug #10303: Misleading Last_query_cost value).

parent 211b78b6
...@@ -541,6 +541,9 @@ JOIN::optimize() ...@@ -541,6 +541,9 @@ JOIN::optimize()
DBUG_RETURN(0); DBUG_RETURN(0);
optimized= 1; optimized= 1;
if (thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
thd->status_var.last_query_cost= 0.0;
row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR : row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR :
unit->select_limit_cnt); unit->select_limit_cnt);
/* select_limit is used to decide if we are likely to scan the whole table */ /* select_limit is used to decide if we are likely to scan the whole table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment