Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: SHOW GRANTS ON TYPE does not work for types not in the current database #67512

Closed
RichardJCai opened this issue Jul 12, 2021 · 0 comments · Fixed by #68137
Closed

sql: SHOW GRANTS ON TYPE does not work for types not in the current database #67512

RichardJCai opened this issue Jul 12, 2021 · 0 comments · Fixed by #68137
Assignees
Labels
A-sql-privileges SQL privilege handling and permission checks. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@RichardJCai
Copy link
Contributor

RichardJCai commented Jul 12, 2021

SHOW GRANTS ON TYPE will only show grants if the type is in the current database.
Specifying a type in another database does not work.

[email protected]:26257/movr> create database test;
CREATE DATABASE


Time: 3ms total (execution 3ms / network 0ms)

[email protected]:26257/movr> create type test.typ as enum();
CREATE TYPE


Time: 4ms total (execution 4ms / network 0ms)

[email protected]:26257/movr> create user testuser;
CREATE ROLE


Time: 28ms total (execution 28ms / network 0ms)

[email protected]:26257/movr> grant all on type test.typ to testuser;
length: 1
GRANT


Time: 26ms total (execution 26ms / network 0ms)


[email protected]:26257/movr> show grants on type test.typ;
  database_name | schema_name | type_name | grantee | privilege_type
----------------+-------------+-----------+---------+-----------------
(0 rows)


Time: 14ms total (execution 14ms / network 0ms)

Epic CRDB-7217

@RichardJCai RichardJCai added C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. A-sql-privileges SQL privilege handling and permission checks. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) labels Jul 12, 2021
@rafiss rafiss self-assigned this Jul 27, 2021
@craig craig bot closed this as completed in c4702ef Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-privileges SQL privilege handling and permission checks. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants