From 79b0ff88fb18fbe09e08df67eae170339ee3a5bf Mon Sep 17 00:00:00 2001 From: hjxilinx Date: Mon, 10 Feb 2020 03:28:11 +0800 Subject: [PATCH] fix query bugs. --- src/system/detail/src/vnodeQueryImpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index 017ff02cfc..2ba38d3e9e 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -7245,7 +7245,8 @@ static void doApplyIntervalQueryOnBlock_rv(SMeterQuerySupportObj *pSupporter, SM // while the interval time window is less than the time range gap between two points, nextKey may be greater than // pSupporter->rawEKey - if (pQuery->ekey == pSupporter->rawEKey || nextKey > pSupporter->rawEKey) { + if (pQuery->ekey == pSupporter->rawEKey || (nextKey > pSupporter->rawEKey && QUERY_IS_ASC_QUERY(pQuery)) || + (nextKey < pSupporter->rawEKey && !QUERY_IS_ASC_QUERY(pQuery))) { /* whole query completed, save result and abort */ saveResult(pSupporter, pMeterQueryInfo, pMeterQueryInfo->lastResRows);