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: fix getPlanColumns for hookFnNode #40616

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

RaduBerinde
Copy link
Member

getPlanColumns allows the caller to directly mutate the columns of a
hookFnNode; but these columns can be defined globally and should not
be modified in place.

Fixes #40585.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@RaduBerinde
Copy link
Member Author

I haven't been able to reproduce but this can definitely cause that race (and it's very likely we're dealing with a hookFnNode given that it was a backupccl test).

Copy link
Collaborator

@rytaft rytaft left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @justinj and @RaduBerinde)


pkg/sql/plan_columns.go, line 121 at r1 (raw file):

		return n.getColumns(mut, sqlbase.ExportColumns)

	case *hookFnNode:

[nit] does the blank line mean this node is in a different category? If so, maybe deserves a comment

Copy link
Contributor

@justinj justinj left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

`getPlanColumns` allows the caller to directly mutate the columns of a
`hookFnNode`; but these columns can be defined globally and should not
be modified in place.

Fixes cockroachdb#40585.

Release note: None
Copy link
Member Author

@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.

Reviewable status: :shipit: complete! 2 of 0 LGTMs obtained (waiting on @rytaft)


pkg/sql/plan_columns.go, line 121 at r1 (raw file):

Previously, rytaft (Rebecca Taft) wrote…

[nit] does the blank line mean this node is in a different category? If so, maybe deserves a comment

Done.

@RaduBerinde
Copy link
Member Author

bors r+

craig bot pushed a commit that referenced this pull request Sep 10, 2019
40616: sql: fix getPlanColumns for hookFnNode r=RaduBerinde a=RaduBerinde

`getPlanColumns` allows the caller to directly mutate the columns of a
`hookFnNode`; but these columns can be defined globally and should not
be modified in place.

Fixes #40585.

Release note: None

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

craig bot commented Sep 10, 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.

opt: Data race in optbuilder and execFactory
4 participants