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: bugfix for planning of wrapped values nodes #37164

Merged
merged 1 commit into from
Apr 26, 2019

Conversation

jordanlewis
Copy link
Member

Previously, there could be a runtime issue if a locally-planned
valuesNode produced omitted columns, because there was a mismatch in the
code that determined whether nodes had to be wrapped versus the code
that produced wrapped nodes.

It's hard to write a test for this because there was no way to get this
problem before. The upcoming change to show_stats will exercise and test
this change.

Fixes #37146.

Release note: None

@jordanlewis jordanlewis requested review from RaduBerinde and a team April 26, 2019 18:52
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

:lgtm: Awesome, thank you so much!

[nit] s/show_stats/show_zone_config in the commit message (I won't be modifying show_stats, it was just for the reproing).

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @RaduBerinde)


pkg/sql/distsql_physical_planner.go, line 315 at r1 (raw file):

	case *unionNode:
	case *valuesNode:
		if !n.specifiedInQuery || planCtx.isLocal || planCtx.noEvalSubqueries {

[nit] Move this block outside of the other cases which are all the same. Also remove the else, golint complains.

Copy link
Member

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

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

Verified that the fix works with my show_zone_config change.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis and @RaduBerinde)

Previously, there could be a runtime issue if a locally-planned
valuesNode produced omitted columns, because there was a mismatch in the
code that determined whether nodes had to be wrapped versus the code
that produced wrapped nodes.

It's hard to write a test for this because there was no way to get this
problem before. The upcoming change to show_zone_config will exercise
and test this change.

Release note: None
@jordanlewis
Copy link
Member Author

ccache flake. TFTR!

bors r+

craig bot pushed a commit that referenced this pull request Apr 26, 2019
37164: sql: bugfix for planning of wrapped values nodes r=jordanlewis a=jordanlewis

Previously, there could be a runtime issue if a locally-planned
valuesNode produced omitted columns, because there was a mismatch in the
code that determined whether nodes had to be wrapped versus the code
that produced wrapped nodes.

It's hard to write a test for this because there was no way to get this
problem before. The upcoming change to show_stats will exercise and test
this change.

Fixes #37146.

Release note: None

Co-authored-by: Jordan Lewis <[email protected]>
@craig
Copy link
Contributor

craig bot commented Apr 26, 2019

Build succeeded

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.

sql: crash with wrapped planNodes with omitted columns
3 participants