From aafb0bc1c06576a44ac67d5ca7ebc208e30bfafc Mon Sep 17 00:00:00 2001 From: hzcheng Date: Sun, 19 Apr 2020 20:52:47 +0800 Subject: [PATCH] TD-100 --- src/tsdb/src/tsdbRWHelper.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbRWHelper.c b/src/tsdb/src/tsdbRWHelper.c index 5b954c43b8..5aeed0c508 100644 --- a/src/tsdb/src/tsdbRWHelper.c +++ b/src/tsdb/src/tsdbRWHelper.c @@ -342,7 +342,7 @@ int tsdbWriteDataBlock(SRWHelper *pHelper, SDataCols *pDataCols) { rowsToWrite = tsdbGetRowsInRange(pDataCols, 0, pCompBlock->keyFirst-1); ASSERT(rowsToWrite > 0); if (tsdbWriteBlockToFile(pHelper, &(pHelper->files.dataF), pDataCols, rowsToWrite, &compBlock, false, true) < 0) goto _err; - if (tsdbInsertSuperBlock(pHelper, pCompBlock, blkIdx) < 0) goto _err; + if (tsdbInsertSuperBlock(pHelper, &compBlock, blkIdx) < 0) goto _err; } } } @@ -987,6 +987,10 @@ static int tsdbInsertSuperBlock(SRWHelper *pHelper, SCompBlock *pCompBlock, int pIdx->maxKey = pHelper->pCompInfo->blocks[pIdx->numOfSuperBlocks - 1].keyLast; pIdx->hasLast = pHelper->pCompInfo->blocks[pIdx->numOfSuperBlocks - 1].last; + if (pIdx->numOfSuperBlocks > 1) { + ASSERT(pHelper->pCompInfo->blocks[0].keyLast < pHelper->pCompInfo->blocks[1].keyFirst); + } + return 0; _err: -- GitLab