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: no privileges required for SHOW CONSTRAINTS #8655

Closed
jseldess opened this issue Aug 18, 2016 · 0 comments
Closed

sql: no privileges required for SHOW CONSTRAINTS #8655

jseldess opened this issue Aug 18, 2016 · 0 comments
Assignees

Comments

@jseldess
Copy link
Contributor

PR #8070 changed table-based SHOW statements to require any privileges, but we missed SHOW CONSTRAINTS:

jesseseldess@JESSEs-MacBook-Pro:~/src/github.com/cockroachdb/cockroach$ cockroach sql
# Welcome to the cockroach SQL interface.
# All statements must be terminated by a semicolon.
# To exit: CTRL + D.
root@:26257> create table test.a (a int);
CREATE TABLE
root@:26257> grant select on test.a to jsel;
GRANT
root@:26257> show grants on test.a;
+-------+------+------------+
| Table | User | Privileges |
+-------+------+------------+
| a     | jsel | SELECT     |
| a     | root | ALL        |
+-------+------+------------+
(2 rows)
root@:26257> ^D
jesseseldess@JESSEs-MacBook-Pro:~/src/github.com/cockroachdb/cockroach$ cockroach sql --user=maxroach
# Welcome to the cockroach SQL interface.
# All statements must be terminated by a semicolon.
# To exit: CTRL + D.
maxroach@:26257> show constraints from test.a;
+-------+---------+-------------+-----------+---------+
| Table |  Name   |    Type     | Column(s) | Details |
+-------+---------+-------------+-----------+---------+
| a     | primary | PRIMARY KEY | [rowid]   | NULL    |
+-------+---------+-------------+-----------+---------+
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants