Description:
The following test case demonstrates the problem:
...
create view v1 as
(select * from information_schema.TP_THREAD_STATE);
create table t1 (f1 int);
create view v2 as (select * from t1);
show columns from v1;
Field Type Null Key Default Extra
TP_GROUP_ID int(6) unsigned NO 0
TP_THREAD_NUMBER int(6) unsigned NO 0
PROCESS_COUNT bigint(20) unsigned NO 0
WAIT_TYPE varchar(30) YES NULL
show columns from v2;
Field Type Null Key Default Extra
f1 int(11) YES NULL
UNINSTALL PLUGIN TP_THREAD_STATE;
drop table t1;
show columns from v1;
Field Type Null Key Default Extra
TP_GROUP_ID int(6) unsigned NO 0
TP_THREAD_NUMBER int(6) unsigned NO 0
PROCESS_COUNT bigint(20) unsigned NO 0
WAIT_TYPE varchar(30) YES NULL
show columns from v2;
ERROR HY000: View 'test.v2' references invalid table(s) or
column(s) or function(s) or definer/invoker of view lack rights
to use them
...
SHOW COLUMNS on v1 above should have reported same error as that
of last SHOW COLUMNS.
- Views that are based on I_S plug-ins are not marked as invalid,
if the I_S plugin is not available.
- This also means that view should be marked as valid, if the
related I_S plugin is loaded.
- Note that a I_S plugin can also be loaded and unloaded while
server restart, apart from INSTALL/UNINSTALL command. So, this
bug should consider mark the view validity upon server restarts
also.
How to repeat:
As described above.