mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B30377-5.0-opt
This commit is contained in:
@ -4401,9 +4401,13 @@ choose_plan(JOIN *join, table_map join_tables)
|
||||
|
||||
/*
|
||||
Store the cost of this query into a user variable
|
||||
Don't update last_query_cost for 'show status' command
|
||||
Don't update last_query_cost for 'show status' command.
|
||||
Don't update last_query_cost for statements that are not "flat joins" :
|
||||
i.e. they have subqueries, unions or call stored procedures.
|
||||
TODO: calculate a correct cost for a query with subqueries and UNIONs.
|
||||
*/
|
||||
if (join->thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS)
|
||||
if (join->thd->lex->orig_sql_command != SQLCOM_SHOW_STATUS &&
|
||||
join->thd->lex->is_single_level_stmt())
|
||||
join->thd->status_var.last_query_cost= join->best_read;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user