Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 10.4(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
None
Description
To get optimizer trace for a query involving a view, the user has to have all global privileges. Removing any privilege, even completely irrelevant like REPLICATION SLAVE ADMIN or DELETE HISTORY, makes the optimizer trace remain empty. No errors or warnings are produced.
create table t (a int); |
create view v as select * from t; |
|
create user all_priv@localhost; |
grant all on *.* to all_priv@localhost; |
|
create user all_but_one@localhost; |
grant all on *.* to all_but_one@localhost; |
revoke DELETE HISTORY on *.* from all_but_one@localhost; |
|
--connect(con_all_priv,localhost,all_priv,,test)
|
|
set optimizer_trace= 'enabled=on'; |
select * from t; |
select query, length(trace) from information_schema.optimizer_trace; |
select * from v; |
select query, length(trace) from information_schema.optimizer_trace; |
|
--connect(con_all_but_one,localhost,all_but_one,,test)
|
|
set optimizer_trace= 'enabled=on'; |
select * from t; |
select query, length(trace) from information_schema.optimizer_trace; |
select * from v; |
select query, length(trace) from information_schema.optimizer_trace; |
|
# Cleanup
|
--disconnect con_all_priv
|
--disconnect con_all_but_one
|
--connection default
|
drop user all_priv@localhost, all_but_one@localhost; |
drop view v; |
drop table t; |
10.4 f97f6955 |
connect con_all_but_one,localhost,all_but_one,,test; |
set optimizer_trace= 'enabled=on'; |
select * from t; |
a
|
select query, length(trace) from information_schema.optimizer_trace; |
query length(trace)
|
select * from t 933 |
select * from v; |
a
|
select query, length(trace) from information_schema.optimizer_trace; |
query length(trace)
|
0
|