-
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: use a 3-valued type instead of 2 booleans for relocate statements #73803
Conversation
The idiom for positional keywords in SQL is to either use words separated by spaces (e.g. NOT NULL), or to concatenate the words together (ISERROR, NOLOGIN, LINESTRING). Release note (sql change): In the experimental RELOCATE syntax forms, the positional keyword that indicates that the statement should move non-voter replicas is now spelled `NONVOTERS`, instead of `NON_VOTERS` previously.
928009d
to
dd9e307
Compare
Release note (sql change): The inline help for the ALTER statements now mentions the RELOCATE syntax.
dd9e307
to
4092554
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @arulajmani, @knz, and @lunevalex)
pkg/sql/sem/tree/alter_range.go, line 29 at r4 (raw file):
// RelocateSubject indicates what replicas of a range should be relocated. type RelocateSubject int
[supernit] It won't matter here, but it's good practice to use small types when they're sufficient (int8
here)
88161fe
to
4092554
Compare
There is no need for separate non-terminals for the 'LEASE' variants of RELOCATE. This commit deletes them. Release note: None
By using a 3-valued types, we greatly simplify the code to print out statement types, and also clarify intent in all the conditionals that depend on the relocation mode. Release note: None
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @arulajmani, @lunevalex, and @RaduBerinde)
pkg/sql/sem/tree/alter_range.go, line 29 at r4 (raw file):
Previously, RaduBerinde wrote…
[supernit] It won't matter here, but it's good practice to use small types when they're sufficient (
int8
here)
Good idea. Done.
4092554
to
285cce1
Compare
TFYR bors r=RaduBerinde |
Build succeeded: |
Informs #73315.
First 3 commits from #73802 (reviewers, focus on the last commit)
By using a 3-valued types, we greatly simplify the code to print out
statement types, and also clarify intent in all the conditionals that
depend on the relocation mode.