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

ts: Fix nil pointer panic on invalid TS query #23764

Merged

Conversation

mrtracy
Copy link
Contributor

@mrtracy mrtracy commented Mar 12, 2018

A query which specified an invalid enumeration value for
SourceAggregator would cause a nil pointer panic on the server.
Repaired this fix and added a test for invalid values of all the
enumeration values of the query request.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@a-robinson a-robinson left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1136,7 +1140,7 @@ func getExtractionFunction(agg tspb.TimeSeriesQueryAggregator) (extractFn, error
case tspb.TimeSeriesQueryAggregator_MIN:
return (roachpb.InternalTimeSeriesSample).Minimum, nil
}
return nil, errors.Errorf("query specified unknown time series aggregator %s", agg.String())
return nil, errors.Errorf("query specified unknown time series downsampler %s", agg.String())
Copy link
Contributor

Choose a reason for hiding this comment

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

It's an existing problem, but the function comments on getExtractionFunction and getDownsampleFunction are incomplete.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, they do return, so at least they're not incorrect! Removed the stub comments, they are unnecessary.

A query which specified an invalid enumeration value for
SourceAggregator would cause a nil pointer panic on the server.
Repaired this fix and added a test for invalid values of all the
enumeration values of the query request.

Fixes cockroachdb#23766

Release note: None
@mrtracy mrtracy force-pushed the mtracy/ts_fix_nil_pointer_aggregator branch from c7b84d9 to f83d2ea Compare March 13, 2018 15:35
@jordanlewis
Copy link
Member

Pretty sure this is related to #23766, fyi

@mrtracy
Copy link
Contributor Author

mrtracy commented Mar 13, 2018

@jordanlewis yes, I actually caused #23766 while working on #23771. I've updated the commit message here to close it.

@mrtracy mrtracy merged commit 3879b31 into cockroachdb:master Mar 13, 2018
@mrtracy mrtracy deleted the mtracy/ts_fix_nil_pointer_aggregator branch March 13, 2018 16:29
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.

4 participants