You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BUG#20483278 LAST_QUERY_COST SHOWS DIFFERENT VALUES FOR SHOW_COMPATIBLITY
FOR ON VS OFF
BUG#21788549 LAST_QUERY_PARTIAL_PLANS VALUES NOT SAME WITH
SHOW_COMPATIBILITY_56
Before this fix,
With SHOW_COMPATIBILITY_56=ON,
The statement
SHOW STATUS like 'Last_query_cost';
was executed with dedicated code in the information schema
(sql/sql_show.cc), which is -- not -- implemented as a storage engine.
As a result, this statement did not execute code in the optimizer,
which did not overwrite the session status variable 'Last_query_cost'
for the current select statement.
As a result, the value of 'Last_query_cost' reported was
for the previous SELECT statement executed in the session.
With SHOW_COMPATIBILITY_56=OFF,
SHOW STATUS like 'Last_query_cost';
is executed as a SELECT ... FROM performance_schema.session_status.
This table is implemented with a storage engine,
and the optimizer code is used.
By the time the value is returned, the value of 'Last_query_cost'
reported is the value just overwritten by the optimizer for the current
statement, which is not the desired result.
The fix is to separate clearly in the session attributes:
- the value of 'Last_query_cost' for the current query,
- the value of 'Last_query_cost' for the previous query,
and only save the former in the later when query execution is complete.
The same issue exists for Last_query_partial_plan,
which is fixed the same way.
0 commit comments