diff --git a/source/libs/index/src/index.c b/source/libs/index/src/index.c index 44d3066589..b5a65a9fda 100644 --- a/source/libs/index/src/index.c +++ b/source/libs/index/src/index.c @@ -401,7 +401,7 @@ int indexFlushCacheTFile(SIndex* sIdx, void* cache) { IndexCache* pCache = (IndexCache*)cache; TFileReader* pReader = tfileGetReaderByCol(sIdx->tindex, pCache->suid, pCache->colName); - if (pReader == NULL) { indexWarn("empty pReader found"); } + if (pReader == NULL) { indexWarn("empty tfile reader found"); } // handle flush Iterate* cacheIter = indexCacheIteratorCreate(pCache); Iterate* tfileIter = tfileIteratorCreate(pReader); @@ -512,6 +512,7 @@ static int indexGenTFile(SIndex* sIdx, IndexCache* cache, SArray* batch) { return ret; END: tfileWriterClose(tw); + return -1; } int32_t indexSerialCacheKey(ICacheKey* key, char* buf) { diff --git a/source/libs/index/test/indexTests.cc b/source/libs/index/test/indexTests.cc index 0ce48bcec4..2ba6b505c5 100644 --- a/source/libs/index/test/indexTests.cc +++ b/source/libs/index/test/indexTests.cc @@ -934,6 +934,7 @@ TEST_F(IndexEnv2, testIndex_read_performance) { index->PutOneTarge("tag1", "Hello", 15); index->ReadMultiMillonData("tag1", "Hello"); std::cout << "reader sz: " << index->SearchOne("tag1", "Hello") << std::endl; + assert(3 == index->SearchOne("tag1", "Hello")); } TEST_F(IndexEnv2, testIndexMultiTag) { std::string path = "/tmp/test3";