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;
|