Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
create database db; |
use db; |
create table t (i int); |
|
create user foo@localhost; |
grant all on db.* to foo@localhost; |
|
--connect (con1,localhost,foo,,)
|
|
use db; |
create view v as select * from (select i from t group by i) sq; |
select * from v; |
|
# Cleanup
|
--disconnect con1
|
--connection default
|
drop view v; |
drop table t; |
drop user foo@localhost; |
The view gets created all right, but SELECT * FROM v fails:
mysqltest: At line 12: query 'select * from v' failed: 1356: View 'db.v' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
|
Here is a slightly different test case which might give a hint for a reason:
create database db; |
use db; |
create table t1 (i int); |
create table t2 (j int); |
|
create user foo@localhost; |
grant all on db.* to foo@localhost; |
|
--connect (con1,localhost,foo,,)
|
|
use db; |
create view v as select 1 from t1 inner join (select j from t2 group by j) `rs` on(i = j); |
select * from v; |
|
# Cleanup
|
--disconnect con1
|
--connection default
|
drop view v; |
drop table t1, t2; |
drop user foo@localhost; |
In this case, SELECT ends with a different error:
mysqltest: At line 13: query 'select * from v' failed: 1143: SELECT command denied to user 'foo'@'localhost' for column 'j' in table '/data/bld/10.2/mysql-test/var/tmp/mysqld.1/#sql_23ef_0'
|
So, it looks like it's the temporary table that the user has no access to.
Attachments
Issue Links
- relates to
-
MDEV-13523 Group By in a View, called within a Stored Routine causes Error Code 1356 when a non-root user runs the routine for a second time
- Closed