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

cli/sql: fix the handling of --set #46118

Merged
merged 1 commit into from
Mar 15, 2020
Merged

Conversation

knz
Copy link
Contributor

@knz knz commented Mar 14, 2020

Fixes #46116

I intend to backport this to 19.2 (bug fix)

Release justification: Category 2: Bug fixes and low-risk updates to new functionality

Release note (bug fix): The parameter --set for cockroach sql and
cockroach demo is now properly able to override all client-side
options, as advertised.

@knz knz requested a review from otan March 14, 2020 15:24
@knz knz requested a review from a team as a code owner March 14, 2020 15:24
@knz knz added this to To do in DB Server & Security via automation Mar 14, 2020
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz requested a review from rohany March 14, 2020 15:29
@knz knz force-pushed the 20200314-cli-opts branch 2 times, most recently from 70f36d8 to c54347a Compare March 14, 2020 16:46
@knz knz moved this from To do to In progress in DB Server & Security Mar 14, 2020
Copy link
Contributor

@rohany rohany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to confirm from reading, this change just moves all the default settings logic into a separate function, and then runs the user provided overrides after the setup logic has run?

pkg/cli/sql.go Outdated
sqlCtx.showTimes = true
}
if cliCtx.isInteractive && !sqlCtx.debugMode {
// If the terminal is interactive and this was not explicitly disabled by setting the debug mode,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit]: long comment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@knz
Copy link
Contributor Author

knz commented Mar 14, 2020

Just to confirm from reading, this change just moves all the default settings logic into a separate function, and then runs the user provided overrides after the setup logic has run?

yes

@rohany
Copy link
Contributor

rohany commented Mar 14, 2020

lgtm

Release justification: Category 2: Bug fixes and low-risk updates to new functionality

Release note (bug fix): The parameter `--set` for `cockroach sql` and
`cockroach demo` is now properly able to override all client-side
options, as advertised.
@knz
Copy link
Contributor Author

knz commented Mar 15, 2020

TFYR

bors r=rohany

@craig
Copy link
Contributor

craig bot commented Mar 15, 2020

Canceled

@knz
Copy link
Contributor Author

knz commented Mar 15, 2020

bors r=rohany

@craig
Copy link
Contributor

craig bot commented Mar 15, 2020

Build succeeded

@craig craig bot merged commit d8bdc93 into cockroachdb:master Mar 15, 2020
DB Server & Security automation moved this from In progress to Done 20.1 Mar 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cli/sql: --set does not properly override defaults
3 participants