diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 69b6fe312c..323a5aed3f 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -2362,7 +2362,7 @@ int32_t resultInfoSafeCheck(SReqResultInfo* pResultInfo) { return TSDB_CODE_TSC_INTERNAL_ERROR; } for (int32_t i = 0; i < pResultInfo->numOfCols; ++i) { - if (pResultInfo->fields[i].bytes <= 0) { + if (pResultInfo->fields[i].bytes < 0) { tscError("checkResultInfo error: bytes:%d <= 0", pResultInfo->fields[i].bytes); return TSDB_CODE_TSC_INTERNAL_ERROR; } diff --git a/source/common/src/tdatablock.c b/source/common/src/tdatablock.c index 2da83a6b74..d41b433468 100644 --- a/source/common/src/tdatablock.c +++ b/source/common/src/tdatablock.c @@ -3165,7 +3165,7 @@ int32_t blockEncode(const SSDataBlock* pBlock, char* data, size_t dataBuflen, in return dataLen; _exit: - uError("blockEncode dataLen:%d, dataBuflen:%" PRIx64, dataLen, dataBuflen); + uError("blockEncode dataLen:%d, dataBuflen:%" PRIu64, dataLen, dataBuflen); terrno = TSDB_CODE_QRY_EXECUTOR_INTERNAL_ERROR; return -1; } diff --git a/source/libs/executor/src/dataDispatcher.c b/source/libs/executor/src/dataDispatcher.c index b9fbf06ef6..d358cedfb7 100644 --- a/source/libs/executor/src/dataDispatcher.c +++ b/source/libs/executor/src/dataDispatcher.c @@ -84,10 +84,10 @@ static int32_t toDataCacheEntry(SDataDispatchHandle* pHandle, const SInputData* pBuf->useSize = sizeof(SDataCacheEntry); { + // allocate additional 8 bytes to avoid invalid write if compress failed to reduce the size size_t dataEncodeBufSize = pBuf->allocSize + 8; if ((pBuf->allocSize > tsCompressMsgSize) && (tsCompressMsgSize > 0) && pHandle->pManager->cfg.compress) { if (pHandle->pCompressBuf == NULL) { - // allocate additional 8 bytes to avoid invalid write if compress failed to reduce the size pHandle->pCompressBuf = taosMemoryMalloc(dataEncodeBufSize); if (NULL == pHandle->pCompressBuf) { QRY_RET(terrno);