-
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
add a new table user_privileges #15745
Conversation
Thanks for your contribution, @yangliang9004! It's much appreciated. I'll defer the final decision to @jordanlewis (or someone else more familiar with the code), but I've left you some small style feedback in the meantime. Reviewed 2 of 2 files at r1. pkg/sql/information_schema.go, line 422 at r1 (raw file):
Stray space here between pkg/sql/information_schema.go, line 424 at r1 (raw file):
Ditto here between pkg/sql/information_schema.go, line 432 at r1 (raw file):
FYI we avoid capitalized types in Go unless they're intended to be exported. But I think you can kill this entire type if you make the change suggested in the next comment. pkg/sql/information_schema.go, line 439 at r1 (raw file):
pkg/sql/information_schema.go, line 443 at r1 (raw file):
I don't think you actually use the de-duplicating properties of this map, so I think it'd be cleaner if you inlined the call to
pkg/sql/testdata/logic_test/information_schema, line 925 at r1 (raw file):
Looks like some trailing spaces slipped into these lines. Comments from Reviewable |
@benesch , I have tried to do as you say, but the output as follows, it really have a lot of repetition, so I have to use the de-duplicating properties of this map, then it will have the correct output :
|
1b142cb
to
89d47a1
Compare
@benesch I have deleted the redundant spaces in "pkg/sql/information_schema.go" and "pkg/sql/testdata/logic_test/information_schema" |
Thanks for your contribution! This change is not quite correct, unfortunately. The CockroachDB does not currently have the capability of modifying the global privileges for users. It only allows modifying the database-level or table-level privileges for users. Therefore, this table should contain a single entry for every privilege against root - and that's it! You should not need to iterate over any descriptors. Does that make sense? Can you make that change? Review status: 0 of 2 files reviewed at latest revision, 6 unresolved discussions, all commit checks successful. Comments from Reviewable |
@jordanlewis Yeah ! I can make this change . |
89d47a1
to
cd37fdc
Compare
@jordanlewis HI, I have made the change , look forward to your advice. Thanks. |
Excellent! This looks correct. I have one small comment, after you address it we'll be good to merge. Reviewed 2 of 2 files at r2. pkg/sql/information_schema.go, line 432 at r2 (raw file):
Pull this out of the loop - we don't need to reallocate this every time. Comments from Reviewable |
@jordanlewis do you mean that I shoud write as the follows:
|
No, I mean:
|
you are right , I get it . |
cd37fdc
to
643a1e7
Compare
@jordanlewis I have change as the comment say, look forward to your advice. Thanks. |
Review status: 1 of 2 files reviewed at latest revision, 7 unresolved discussions, all commit checks successful. Comments from Reviewable |
Thanks @yangliang9004! |
sql: Complete the information_schema, add a new table user_privileges , please see #8675