diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index cb50eaf896972d0d80a719db00036ead5cb0b616..7d366ec8147295a7aec47e6777b61f949a96c897 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -280,16 +280,12 @@ static SArray* createCheckInfoFromTableGroup(STsdbQueryHandle* pQueryHandle, STa info.tableId.uid = info.pTableObj->tableId.uid; if (ASCENDING_TRAVERSE(pQueryHandle->order)) { - if (info.lastKey == INT64_MIN) { + if (info.lastKey == INT64_MIN || info.lastKey < pQueryHandle->window.skey) { info.lastKey = pQueryHandle->window.skey; } assert(info.lastKey >= pQueryHandle->window.skey && info.lastKey <= pQueryHandle->window.ekey); } else { - if (info.lastKey == INT64_MIN) { - info.lastKey = pQueryHandle->window.ekey; - } - assert(info.lastKey >= pQueryHandle->window.ekey && info.lastKey <= pQueryHandle->window.skey); }