fix file corrupt

This commit is contained in:
Hongze Cheng 2022-06-30 06:47:47 +00:00
parent 13d3657269
commit 0e6760702e
1 changed files with 2 additions and 0 deletions

View File

@ -557,6 +557,7 @@ int32_t tsdbReadBlockIdx(SDataFReader *pReader, SArray *aBlockIdx, uint8_t **ppB
}
// decode
n = 0;
n = tGetU32(*ppBuf + n, &delimiter);
ASSERT(delimiter == TSDB_FILE_DLMT);
@ -1285,6 +1286,7 @@ int32_t tsdbWriteBlockIdx(SDataFWriter *pWriter, SArray *aBlockIdx, uint8_t **pp
if (code) goto _err;
// build
n = 0;
n = tPutU32(*ppBuf + n, TSDB_FILE_DLMT);
for (int32_t iBlockIdx = 0; iBlockIdx < taosArrayGetSize(aBlockIdx); iBlockIdx++) {
n += tPutBlockIdx(*ppBuf + n, taosArrayGet(aBlockIdx, iBlockIdx));