Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
When the user is created without SELECT privilege and after that applied the SELECT privilege nothing changes:
create database db; |
create user foo@localhost; |
grant create on db.* to foo@localhost; |
|
--connect (con1,localhost,foo,,db)
|
create table t (a int, key(a)); |
show create table t; |
--error ER_TABLEACCESS_DENIED_ERROR
|
show columns in t; |
--error ER_TABLEACCESS_DENIED_ERROR
|
show index in t; |
|
# Give the user select privilege |
--connection default
|
grant select on db.* to foo@localhost; |
|
--connection con1
|
show grants for current_user; |
Grants for foo@localhost |
GRANT USAGE ON *.* TO `foo`@`localhost` |
GRANT SELECT, CREATE ON `db`.* TO `foo`@`localhost` |
|
# This should be visible but is not - bug! still ER_TABLEACCESS_DENIED_ERROR |
show columns in t; |
8: query 'show columns in t' failed: ER_TABLEACCESS_DENIED_ERROR (1142): SELECT command denied to user 'foo'@'localhost' for table 't' |
|
# This should be visible but is not - bug! still ER_TABLEACCESS_DENIED_ERROR |
show index in t; |
|
# Cleanup
|
--disconnect con1
|
--connection default
|
drop database db; |
drop user foo@localhost; |
However if we create new user that has just SELECT priv it works
--connection default
|
create user bar@localhost; |
grant select on db.* to bar@localhost; |
show grants for bar@localhost; |
Grants for bar@localhost |
GRANT USAGE ON *.* TO `bar`@`localhost` |
GRANT SELECT ON `db`.* TO `bar`@`localhost` |
|
--connect (con2,localhost,bar,,db)
|
show index in t; |
Table Non_unique Key_name Seq_in_index Column_name Collation CardinalitySub_part Packed Null Index_type Comment Index_comment Ignored |
t 1 a 1 a A NULL NULL NULL YES BTREE NO |
show columns in t; |
Field Type Null Key Default Extra |
a int(11) YES MUL NULL |
Attachments
Issue Links
- relates to
-
MDEV-28455 CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS
- Closed
-
MDEV-28455 CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS
- Closed