• unknown's avatar
    Bug #30377: EXPLAIN loses last_query_cost when used with UNION · 310afbd4
    unknown authored
    Currently the Last_query_cost session status variable shows
    only the cost of a single flat subselect. For complex queries
    (with subselects or unions etc) Last_query_cost is not valid
    as it was showing the cost for the last optimized subselect.
    Fixed by reseting to zero Last_query_cost when the complete
    cost of the query cannot be determined.
    Last_query_cost will be non-zero only for single flat queries.
    
    
    mysql-test/r/status.result:
      Bug #30377: test case
    mysql-test/t/status.test:
      Bug #30377: test case
    sql/sql_lex.h:
      Bug #30377: helper function
    sql/sql_select.cc:
      Bug #30377: don't assign cost if not on single level statement
    310afbd4
status.result 2.41 KB