diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fb4a34..115ad654 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Release notes ============= +Version 0.8.80 +-------------- + +BUG FIX + +* Fix #357 group-aggreagate query in backward direction returns + invalid first/last values + Version 0.8.79 -------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 27b2b9a9..2b71aeb7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8) set(APP_VERSION_MAJOR "0") set(APP_VERSION_MINOR "8") -set(APP_VERSION_PATCH "79") +set(APP_VERSION_PATCH "80") string(TIMESTAMP APP_COMPILATION_TIME "%Y%m%d") set(APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_PATCH}") diff --git a/libakumuli/storage_engine/operators/operator.cpp b/libakumuli/storage_engine/operators/operator.cpp index f5d8541f..67b46628 100644 --- a/libakumuli/storage_engine/operators/operator.cpp +++ b/libakumuli/storage_engine/operators/operator.cpp @@ -56,17 +56,19 @@ void AggregationResult::add(aku_Timestamp ts, double xs, bool forward) { maxts = ts; } if (cnt == 0) { - first = xs; if (forward) { + first = xs; _begin = ts; } else { + last = xs; _end = ts; } } - last = xs; if (forward) { + last = xs; _end = ts; } else { + first = xs; _begin = ts; } cnt += 1; @@ -83,8 +85,6 @@ void AggregationResult::combine(const AggregationResult& other) { max = other.max; maxts = other.maxts; } - min = std::min(min, other.min); - max = std::max(max, other.max); if (_begin > other._begin) { first = other.first; _begin = other._begin;