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

sql: Record user-provided value to event log when a setting is changed #17866

Merged
merged 1 commit into from Aug 24, 2017

Conversation

a-robinson
Copy link
Contributor

Rather than using the encoded version, which for state-machine settings
(like the cluster version) can be a protocol buffer.

To make this work, I needed parser.StrVal.Format to respect the provided
format strings. To my untrained eye this looked like a bug, but there
may be a reason for it that I'm not aware of.

Fixes #17854

I hope one of you can correct me on the StrVal.Format change if there really is a reason for it not to respect formatting flags.

@a-robinson a-robinson requested review from dt, knz and a team August 23, 2017 19:41
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member

dt commented Aug 23, 2017

:lgtm:


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


pkg/sql/parser/constant.go, line 356 at r1 (raw file):

		encodeSQLBytes(buf, expr.s)
	} else {
		encodeSQLStringWithFlags(buf, expr.s, f)

does this suggest we want a test that hits this?


Comments from Reviewable

Rather than using the encoded version, which for state-machine settings
(like the cluster version) can be a protocol buffer.

To make this work, I needed parser.StrVal.Format to respect the provided
format strings. To my untrained eye this looked like a bug, but there
may be a reason for it that I'm not aware of.

Fixes cockroachdb#17854
@a-robinson
Copy link
Contributor Author

Review status: 0 of 3 files reviewed at latest revision, 1 unresolved discussion.


pkg/sql/parser/constant.go, line 356 at r1 (raw file):

Previously, dt (David Taylor) wrote…

does this suggest we want a test that hits this?

If it's actually the intended behavior, yeah. Done. Although it'd be nice to hear from one other person (@knz? @nvanbenschoten?) that this wasn't intentionally done this way.


Comments from Reviewable

@knz
Copy link
Contributor

knz commented Aug 24, 2017

:lgtm:


Reviewed 2 of 2 files at r1, 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


pkg/sql/parser/constant.go, line 356 at r1 (raw file):

Previously, a-robinson (Alex Robinson) wrote…

If it's actually the intended behavior, yeah. Done. Although it'd be nice to hear from one other person (@knz? @nvanbenschoten?) that this wasn't intentionally done this way.

I don't remember actually. What other things were changed that were using this code path when this was introduced the first time?


Comments from Reviewable

@knz
Copy link
Contributor

knz commented Aug 24, 2017

also nit: we usually do not capitalize the first line of commit messages

@a-robinson
Copy link
Contributor Author

Wow, I've been doing that for a year and never noticed. I'm not alone in doing it, but we're definitely outnumbered. I'll try to switch over in the future.


Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


pkg/sql/parser/constant.go, line 356 at r1 (raw file):

Previously, knz (kena) wrote…

I don't remember actually. What other things were changed that were using this code path when this was introduced the first time?

It traces all the way back to when StrVal was introduced, so it was likely an oversight:
92a6bbb#diff-9498abd5bbdfcd73f8064a4f6e918ee1R239


Comments from Reviewable

@nvanbenschoten
Copy link
Member

Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


pkg/sql/parser/constant.go, line 356 at r1 (raw file):

Previously, a-robinson (Alex Robinson) wrote…

It traces all the way back to when StrVal was introduced, so it was likely an oversight:
92a6bbb#diff-9498abd5bbdfcd73f8064a4f6e918ee1R239

Yeah, that must have just been missed when the Format method was added. Good catch.


Comments from Reviewable

@a-robinson a-robinson merged commit eb884cd into cockroachdb:master Aug 24, 2017
@nvanbenschoten
Copy link
Member

While staying as far away from a bikeshed as possible, can I ask why we usually don't capitalize the first line of commit messages? Is it an arbitrary convention for the sake of standardization (which I'm all for)?

@knz
Copy link
Contributor

knz commented Aug 24, 2017

So my overall approach is like this:

  • if the commit title starts immediately, then capitalize;
  • if the title follows a prefix that names the area where the change occurs (e.g. "sql: ") then don't capitalize, like requested by English grammar: after a colon a capital letter doesn't follow.

Also at a high level since we also have this habit to not end commit titles with a period (I actually disagree with this, but we've been doing that reliably) I never saw them as sentences really and thus didn't see the point of an initial capital.

@nvanbenschoten
Copy link
Member

Ok, thanks for the explanation.

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.

None yet

5 participants