-
Notifications
You must be signed in to change notification settings - Fork 3.9k
sql: fix bug where some session vars couldn't be set to "on" or "off" #46163
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
Conversation
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.
Sorry I don't understand the code change. Why was the previous code incorrect? Can you walk me through the analysis step by step?
Reviewed 2 of 2 files at r1.
Reviewable status:complete! 0 of 0 LGTMs obtained
all vars that had a |
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.
Thanks. Maybe would have helped to add this explanation to the commit message.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rohany)
pkg/sql/vars.go, line 902 at r1 (raw file):
} func makeBoolGetStringValFn(varName string) getStringValFn {
Please spell out the semantics of this function in a docstring above it.
pkg/sql/vars.go, line 1040 at r1 (raw file):
}() func getSingleBool(name string, val tree.Datum) (*tree.DBool, error) {
ditto
Updated. I think this should be backported, what do you think? |
+1 on backport |
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.
Reviewed 1 of 1 files at r2.
Reviewable status:complete! 1 of 0 LGTMs obtained
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 (and 1 stale) (waiting on @knz and @rohany)
pkg/sql/logictest/testdata/logic_test/set, line 336 at r3 (raw file):
# Ensure that we can set variables to on/off. statement ok SET enable_zigzag_join = 'on';
If we want true and false to work as well, we should add those tests too.
bors r+ |
bors r- |
Canceled |
Session variables were incorrectly erroring out on string inputs even though string values of "on" and "off" are accepted. Fixes cockroachdb#46161. Release justification: bug fix Release note (bug fix): This PR fixes a bug where various session variables whose value would display as "on" or "off" could not be set to the values "on" or "off", only true or false.
bors r+ |
Build succeeded |
Session variables were incorrectly erroring out on
string inputs even though string values of "on" and
"off" are accepted.
Fixes #46161.
Release justification: bug fix
Release note (bug fix): This PR fixes a bug where various session
variables whose value would display as "on" or "off" could not be
set to the values "on" or "off", only true or false.