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:Remove number from CREATE/ALTER/DROP ROLE response #46728

Closed
RichardJCai opened this issue Mar 30, 2020 · 0 comments
Closed

sql:Remove number from CREATE/ALTER/DROP ROLE response #46728

RichardJCai opened this issue Mar 30, 2020 · 0 comments
Assignees
Labels
A-sql-privileges SQL privilege handling and permission checks. C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@RichardJCai
Copy link
Contributor

Currently after a success from any of the CREATE/ALTER/DROP ROLE commands, it returns the number of rows affected which includes number of options inserted into the system.role_options table - this is somewhat misleading as the number doesn't really make sense to the user.

Example

[email protected]:63323/defaultdb> create role j with createrole;
CREATE ROLE 3

Goal: Change this to match postgres, have no number.

[email protected]:63323/defaultdb> create role j with createrole;
CREATE ROLE
@RichardJCai RichardJCai added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-sql-privileges SQL privilege handling and permission checks. labels Mar 30, 2020
@RichardJCai RichardJCai self-assigned this Mar 30, 2020
RichardJCai added a commit to RichardJCai/cockroach that referenced this issue Mar 31, 2020
… Add hint for GRANT ROLE.

Fixes cockroachdb#46728, cockroachdb#46698

Release note (sql change): Remove rows affected from CREATE/ALTER/DROP ROLE
command results.
The number doesn't make sense to include since rows affected includes
system.role_options rows, this number can be misleading (ie CREATE ROLE returning 3).
This also matches PG as no number is returned for these commands.

Release note (sql change): Add hint to use ALTER ROLE when trying to
"GRANT" a role option directly to a user (using the GRANT ROLE syntax).

Release justification: Low risk change, command result output changed for
CREATE/ALTER/DROP ROLE. Hint added for GRANT ROLE.
RichardJCai added a commit to RichardJCai/cockroach that referenced this issue Mar 31, 2020
… Add hint for GRANT ROLE.

Fixes cockroachdb#46728, cockroachdb#46698

Release note (sql change): Remove rows affected from CREATE/ALTER/DROP ROLE
command results.
The number doesn't make sense to include since rows affected includes
system.role_options rows, this number can be misleading (ie CREATE ROLE returning 3).
This also matches PG as no number is returned for these commands.

Release note (sql change): Add hint to use ALTER ROLE when trying to
"GRANT" a role option directly to a user (using the GRANT ROLE syntax).

Release justification: Low risk change, command result output changed for
CREATE/ALTER/DROP ROLE. Hint added for GRANT ROLE.
@craig craig bot closed this as completed in 516cc59 Mar 31, 2020
RichardJCai added a commit to RichardJCai/cockroach that referenced this issue Mar 31, 2020
… Add hint for GRANT ROLE.

Fixes cockroachdb#46728, cockroachdb#46698

Release note (sql change): Remove rows affected from CREATE/ALTER/DROP ROLE
command results.
The number doesn't make sense to include since rows affected includes
system.role_options rows, this number can be misleading (ie CREATE ROLE returning 3).
This also matches PG as no number is returned for these commands.

Release note (sql change): Add hint to use ALTER ROLE when trying to
"GRANT" a role option directly to a user (using the GRANT ROLE syntax).

Release justification: Low risk change, command result output changed for
CREATE/ALTER/DROP ROLE. Hint added for GRANT ROLE.
RichardJCai added a commit to RichardJCai/cockroach that referenced this issue Apr 6, 2020
… Add hint for GRANT ROLE.

Fixes cockroachdb#46728, cockroachdb#46698

Release note (sql change): Remove rows affected from CREATE/ALTER/DROP ROLE
command results.
The number doesn't make sense to include since rows affected includes
system.role_options rows, this number can be misleading (ie CREATE ROLE returning 3).
This also matches PG as no number is returned for these commands.

Release note (sql change): Add hint to use ALTER ROLE when trying to
"GRANT" a role option directly to a user (using the GRANT ROLE syntax).

Release justification: Low risk change, command result output changed for
CREATE/ALTER/DROP ROLE. Hint added for GRANT ROLE.
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-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

No branches or pull requests

1 participant