-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: fix username parsing for CURRENT_USER/SESSION_USER #70439
sql: fix username parsing for CURRENT_USER/SESSION_USER #70439
Conversation
cbcc861
to
937f033
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the tree and parser changes only. Generally OK, but I think there's some unnecessary complexity related to the formatting code.
Reviewed 23 of 38 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dt, @rafiss, and @RichardJCai)
pkg/sql/sem/tree/alter_database.go, line 16 at r1 (raw file):
type AlterDatabaseOwner struct { Name Name // TODO(solon): Adjust this, see
Here and elsewhere, remove the TODOs that refer to this specific issue.
pkg/sql/sem/tree/format.go, line 389 at r1 (raw file):
// FormatRoleSpec formats a role specification safely. func (ctx *FmtCtx) FormatRoleSpec(spec RoleSpec) {
I see you also have a Format
method on type RoleSpec
Then you don't need this one. Instead, do ctx.FormatNode(&n.RoleSpec)
on the other nodes, which will also be easier to read and less error-prone.
4819ae0
to
2064b15
Compare
how disruptive to your work would it be to wait on merging sweeping refactors like this, at least if they're also hitting bulk io's packages, until we have a 21.2 RC cut? some teams, mine included, are trying to minimize refactor churn until RC 1 is tagged, so that if we need to prepare an urgent fix for a release-blocking issue, we don't have as much risk of unclean backports delaying it further |
This can definitely wait, I'm actually just picking this up and other smaller issues because I'm waiting on the 21.2 RC cut to merge my other huge PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great! just had a nit, then feel free to merge after 21.2 RC
after this are there any other usages of name_list or name for usernames in sql.y?
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dt, @knz, and @RichardJCai)
pkg/sql/sem/tree/create.go, line 1577 at r2 (raw file):
// TODO(solon): Adjust this, see // https://github.com/cockroachdb/cockroach/issues/54696 AuthRole RoleSpec
nit: remove the todo
This should be ok to merge now right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be ok to merge now right?
I don't have further comments, but there's still one unaddressed comment by rafi.
Reviewed 1 of 38 files at r1, 8 of 11 files at r2, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dt, @knz, and @RichardJCai)
Ah yeah I haven't made those changes yet, more asking in reference to about waiting for 21.2 RC before merging this, |
I no longer have any concern about refactor churn, at least w.r.t. bulk's packages, so no objection here. |
2064b15
to
5f83110
Compare
bors r=rafiss |
Build failed (retrying...): |
Build failed: |
60e09ec
to
439d758
Compare
Release note (sql change): Fix bug where previously CURRENT_USER and SESSION_USER were parsed incorrectly.
439d758
to
d13a9a3
Compare
Fixed merge skew |
Build succeeded: |
Release note (sql change): Fix bug where previously CURRENT_USER and
SESSION_USER were parsed incorrectly.
Fixes #54696