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

release-20.2: sql: fix panic when showing histograms on all-null columns #56516

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

rytaft
Copy link
Collaborator

@rytaft rytaft commented Nov 10, 2020

Backport 1/1 commits from #56434.

/cc @cockroachdb/release


Prior to this commit, attempting to view statistics for a column in which
all values were null could cause the system to panic. This was because the
histogram data was empty, and we were trying to decode an empty byte string.
This commit fixes the panic by checking if the byte string is empty before
trying to decode it, and also ensuring that the column type for the histogram
is set even if there are no buckets.

Fixes #56356

Release note (bug fix): Fixed a panic that could occur when running
SHOW STATISTICS USING JSON for a table in which at least one of the columns
contained all null values.

Prior to this commit, attempting to view statistics for a column in which
all values were null could cause the system to panic. This was because the
histogram data was empty, and we were trying to decode an empty byte string.
This commit fixes the panic by checking if the byte string is empty before
trying to decode it, and also ensuring that the column type for the histogram
is set even if there are no buckets.

Fixes cockroachdb#56356

Release note (bug fix): Fixed a panic that could occur when running `SHOW
STATISTICS USING JSON` for a table in which at least one of the columns
contained all null values.
@rytaft rytaft requested a review from a team as a code owner November 10, 2020 19:01
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@rytaft rytaft merged commit abeb6a5 into cockroachdb:release-20.2 Nov 10, 2020
@rytaft rytaft deleted the backport20.2-56434 branch November 10, 2020 20:57
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

3 participants