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

exec: Fix indexing panic in cast #40502

Closed
wants to merge 1 commit into from

Conversation

rohany
Copy link
Contributor

@rohany rohany commented Sep 5, 2019

The cast operator could panic sometimes due to mismatched
column sizes in a batch. Re-slicing the column to the length
of the batch should ensure that this cannot happen anymore.

Fixes #40461.

Release note: None

The cast operator could panic sometimes due to mismatched
column sizes in a batch. Re-slicing the column to the length
of the batch should ensure that this cannot happen anymore.

Fixes cockroachdb#40461.

Release note: None
@rohany rohany requested review from jordanlewis and a team September 5, 2019 04:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -134,6 +134,7 @@ func (c *castOp_FROMTYPE_TOTYPE) Next(ctx context.Context) coldata.Batch {
}
}
} else {
col = col[:n]
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be col = execgen.SLICE(col, 0, int(n)), since not all types will be normally sliceable like this.

@rohany rohany closed this Sep 5, 2019
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.

roachtest: tpchbench/tpch/nodes=3/cpu=4/sf=1 failed
3 participants