From 6962a8232deb0d3374ff907bfa3ca6e57b6792d6 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Thu, 21 May 2020 17:56:39 +0800 Subject: [PATCH] [td-377] fix crash --- src/tsdb/src/tsdbRead.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 115a32567c..13e8864ba8 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -914,7 +914,10 @@ static void mergeDataInDataBlock(STsdbQueryHandle* pQueryHandle, STableCheckInfo int32_t order = (pQueryHandle->order == TSDB_ORDER_ASC) ? TSDB_ORDER_DESC : TSDB_ORDER_ASC; int32_t end = vnodeBinarySearchKey(pCols->cols[0].pData, pCols->numOfPoints, key, order); - + if (tsArray[end] == key) { // the value of key in cache equals to the end timestamp value, ignore it + tSkipListIterNext(pCheckInfo->iter); + } + int32_t start = -1; if (ASCENDING_ORDER_TRAVERSE(pQueryHandle->order)) { int32_t remain = end - pos + 1; -- GitLab