提交 8c8aa5cd 编写于 作者: H Haojun Liao

fix(tsdb): fix error in extract brinblock.

上级 7d7e12a5
...@@ -867,8 +867,9 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead ...@@ -867,8 +867,9 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
const TBrinBlkArray* pBlkArray = NULL; const TBrinBlkArray* pBlkArray = NULL;
int32_t code = tsdbDataFileReadBrinBlk(pFileReader, &pBlkArray); int32_t code = tsdbDataFileReadBrinBlk(pFileReader, &pBlkArray);
LRUHandle* handle = NULL;
#if 0 #if 0
LRUHandle* handle = NULL;
int32_t code = tsdbCacheGetBlockIdx(pFileReader->pTsdb->biCache, pFileReader, &handle); int32_t code = tsdbCacheGetBlockIdx(pFileReader->pTsdb->biCache, pFileReader, &handle);
if (code != TSDB_CODE_SUCCESS || handle == NULL) { if (code != TSDB_CODE_SUCCESS || handle == NULL) {
goto _end; goto _end;
...@@ -890,9 +891,9 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead ...@@ -890,9 +891,9 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
STableUidList* pList = &pReader->status.uidList; STableUidList* pList = &pReader->status.uidList;
bool newBlk = false; bool newBlk = false;
int32_t i = 0, j = 0; int32_t i = 0;
while (i < pBlkArray->size && j < numOfTables) { while (i < TARRAY2_SIZE(pBlkArray)) {
pBrinBlk = &pBlkArray->data[i]; pBrinBlk = &pBlkArray->data[i];
if (pBrinBlk->maxTbid.suid < pReader->suid) { if (pBrinBlk->maxTbid.suid < pReader->suid) {
i += 1; i += 1;
...@@ -906,16 +907,14 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead ...@@ -906,16 +907,14 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
ASSERT(pBrinBlk->minTbid.suid <= pReader->suid && pBrinBlk->maxTbid.suid >= pReader->suid); ASSERT(pBrinBlk->minTbid.suid <= pReader->suid && pBrinBlk->maxTbid.suid >= pReader->suid);
// this block belongs to a table that is not queried. if (pBrinBlk->maxTbid.uid < pList->tableUidList[0]) {
STableBlockScanInfo* pScanInfo = i += 1;
getTableBlockScanInfo(pReader->status.pTableMap, pList->tableUidList[j], pReader->idStr); newBlk = true;
if (pScanInfo == NULL) { continue;
// tsdbBICacheRelease(pFileReader->pTsdb->biCache, handle);
return terrno;
} }
if (pScanInfo->pBlockList == NULL) { if (pBrinBlk->minTbid.uid > pList->tableUidList[numOfTables - 1]) {
pScanInfo->pBlockList = taosArrayInit(4, sizeof(SBrinRecord)); break;
} }
if (taosArrayGetSize(pIndexList) == 0) { if (taosArrayGetSize(pIndexList) == 0) {
...@@ -926,8 +925,6 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead ...@@ -926,8 +925,6 @@ static int32_t doLoadBlockIndex(STsdbReader* pReader, SDataFileReader* pFileRead
} }
newBlk = false; newBlk = false;
} }
j += 1;
} }
int64_t et2 = taosGetTimestampUs(); int64_t et2 = taosGetTimestampUs();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册