Skip to content
This repository has been archived by the owner on Feb 8, 2019. It is now read-only.

Fix a bug with min/max aggregation. #277

Merged
merged 1 commit into from
Aug 4, 2017
Merged

Conversation

jianqiao
Copy link
Contributor

@jianqiao jianqiao commented Aug 4, 2017

This PR fixes the bug with min/max aggregation (that produces incorrect results) when the aggregated column is stored with leading-zero-truncation compression.

The bug happens because the untyped value (i.e. a const void * pointer) obtained from the leading-zero-truncation compressed column's corresponding ValueAccessor is the address of a temporary buffer -- i.e. the value pointer becomes invalid when the next accessor->next() gets called. Keeping the value pointer across multiple iterations of accessor->next() causes the problem.

The fix is to copy the value pointer's underlying value to a local variable (so that the value remains valid across iterations of accessor->next()).

@zuyu
Copy link
Member

zuyu commented Aug 4, 2017

LGTM.

@asfgit asfgit merged commit 6792570 into master Aug 4, 2017
@asfgit asfgit deleted the fix-compare-aggregate branch August 4, 2017 21:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants