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

Return the correct auxiliary values for top/bottom #9869

Merged
merged 1 commit into from
May 17, 2018

Conversation

jsternberg
Copy link
Contributor

When top() or bottom() were used and selected auxiliary values, they
would return the wrong values that would be equal to the last point
selected. This is because the aggregators saved the memory address of
the auxiliary fields instead of copying them over. Since the same
auxiliary fields memory location is used for every value returned by the
storage engine, this resulted in the values being incorrect because they
were overwritten with incorrect values.

This fixes that so the auxiliary fields are copied out when they are
saved rather than only the memory location.

Backport of #9858.

@ghost ghost assigned jsternberg May 17, 2018
@ghost ghost added the review label May 17, 2018
@hercules-influx
Copy link
Contributor

During a run of megacheck the following issues were discovered:

/tmp/934505966/src/github.com/influxdata/influxdb/query/iterator_test.go:1595:2: field point is unused (U1000)
/tmp/934505966/src/github.com/influxdata/influxdb/query/iterator_test.go:1625:2: field point is unused (U1000)
/tmp/934505966/src/github.com/influxdata/influxdb/query/iterator_test.go:1655:2: field point is unused (U1000)
/tmp/934505966/src/github.com/influxdata/influxdb/query/iterator_test.go:1685:2: field point is unused (U1000)
/tmp/934505966/src/github.com/influxdata/influxdb/query/iterator_test.go:1715:2: field point is unused (U1000)

When `top()` or `bottom()` were used and selected auxiliary values, they
would return the wrong values that would be equal to the last point
selected. This is because the aggregators saved the memory address of
the auxiliary fields instead of copying them over. Since the same
auxiliary fields memory location is used for every value returned by the
storage engine, this resulted in the values being incorrect because they
were overwritten with incorrect values.

This fixes that so the auxiliary fields are copied out when they are
saved rather than only the memory location.
@jsternberg jsternberg force-pushed the js-1.5-top-return-correct-auxiliary-values branch from 7a557d2 to 829bdfb Compare May 17, 2018 19:39
@stuartcarnie
Copy link
Contributor

@jsternberg megacheck errors?

@jsternberg
Copy link
Contributor Author

I think I fixed those.

Copy link
Contributor

@stuartcarnie stuartcarnie left a comment

Choose a reason for hiding this comment

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

If megacheck happy, I'm happy 👍

@jsternberg jsternberg merged commit ef4c39f into 1.5 May 17, 2018
@ghost ghost removed the review label May 17, 2018
@jsternberg jsternberg deleted the js-1.5-top-return-correct-auxiliary-values branch May 17, 2018 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants