From d8218b3872531b718c95a1191310f597e2dda92f Mon Sep 17 00:00:00 2001 From: xsren <285808407@qq.com> Date: Thu, 17 Oct 2024 19:05:23 +0800 Subject: [PATCH] fix: resultDataLen with json col --- source/client/src/clientImpl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 4f268aa96e..d8c01ee17c 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -2196,6 +2196,10 @@ static int32_t estimateJsonLen(SReqResultInfo* pResultInfo) { } pStart += colLen; } + + // Ensure the complete structure of the block, including the blankfill field, + // even though it is not used on the client side. + len += sizeof(bool); return len; } @@ -2341,6 +2345,11 @@ static int32_t doConvertJson(SReqResultInfo* pResultInfo) { pStart1 += colLen1; } + // Ensure the complete structure of the block, including the blankfill field, + // even though it is not used on the client side. + // (void)memcpy(pStart1, pStart, sizeof(bool)); + totalLen += sizeof(bool); + *(int32_t*)(pResultInfo->convertJson + 4) = totalLen; pResultInfo->pData = pResultInfo->convertJson; return TSDB_CODE_SUCCESS; @@ -2367,7 +2376,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, bool convertUcs4) { } if (pResultInfo->pData == NULL) { - tscError("estimateJsonLen error: pData is NULL"); + tscError("setResultDataPtr error: pData is NULL"); return TSDB_CODE_TSC_INTERNAL_ERROR; }