This commit is contained in:
Cary Xu 2022-04-03 18:56:44 +08:00
parent 489f65f2ce
commit 670554dcdd
1 changed files with 5 additions and 5 deletions

View File

@ -1315,7 +1315,7 @@ int tsdbWriteBlockImpl(STsdb *pRepo, STable *pTable, SDFile *pDFile, SDFile *pDF
} }
#endif #endif
void *tptr; void *tptr, *bptr;
// Make room // Make room
if (tsdbMakeRoom(ppBuf, lsize + tlen + tBitmaps + 2 * COMP_OVERFLOW_BYTES + sizeof(TSCKSUM)) < 0) { if (tsdbMakeRoom(ppBuf, lsize + tlen + tBitmaps + 2 * COMP_OVERFLOW_BYTES + sizeof(TSCKSUM)) < 0) {
@ -1340,9 +1340,9 @@ int tsdbWriteBlockImpl(STsdb *pRepo, STable *pTable, SDFile *pDFile, SDFile *pDF
tlen + COMP_OVERFLOW_BYTES, pCfg->compression, *ppCBuf, tlen + COMP_OVERFLOW_BYTES, pCfg->compression, *ppCBuf,
tlen + COMP_OVERFLOW_BYTES); tlen + COMP_OVERFLOW_BYTES);
if (tBitmaps > 0) { if (tBitmaps > 0) {
tptr = POINTER_SHIFT(pBlockData, lsize + flen); bptr = POINTER_SHIFT(pBlockData, lsize + flen);
tBitmapsLen = tBitmapsLen =
tsCompressTinyint((char *)pDataCol->pBitmap, tBitmaps, rowsToWrite, tptr, tBitmaps + COMP_OVERFLOW_BYTES, tsCompressTinyint((char *)pDataCol->pBitmap, tBitmaps, tBitmaps, bptr, tBitmaps + COMP_OVERFLOW_BYTES,
pCfg->compression, *ppCBuf, tBitmaps + COMP_OVERFLOW_BYTES); pCfg->compression, *ppCBuf, tBitmaps + COMP_OVERFLOW_BYTES);
TASSERT((tBitmapsLen > 0) && (tBitmapsLen <= (tBitmaps + COMP_OVERFLOW_BYTES))); TASSERT((tBitmapsLen > 0) && (tBitmapsLen <= (tBitmaps + COMP_OVERFLOW_BYTES)));
flen += tBitmapsLen; flen += tBitmapsLen;
@ -1351,8 +1351,8 @@ int tsdbWriteBlockImpl(STsdb *pRepo, STable *pTable, SDFile *pDFile, SDFile *pDF
flen = tlen; flen = tlen;
memcpy(tptr, pDataCol->pData, flen); memcpy(tptr, pDataCol->pData, flen);
if (tBitmaps > 0) { if (tBitmaps > 0) {
tptr = POINTER_SHIFT(pBlockData, lsize + flen); bptr = POINTER_SHIFT(pBlockData, lsize + flen);
memcpy(tptr, pDataCol->pBitmap, tBitmaps); memcpy(bptr, pDataCol->pBitmap, tBitmaps);
tBitmapsLen = tBitmaps; tBitmapsLen = tBitmaps;
flen += tBitmapsLen; flen += tBitmapsLen;
} }