fix: number to string output length issue

This commit is contained in:
dapan1121 2024-11-01 08:55:03 +08:00
parent 726594b926
commit 016d176ea5
1 changed files with 1 additions and 1 deletions

View File

@ -2085,7 +2085,7 @@ int32_t castFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutp
(void)memcpy(varDataVal(output), convBuf, len);
varDataSetLen(output, len);
} else {
int32_t outputSize = TMIN(outputLen - VARSTR_HEADER_SIZE, bufSize);
int32_t outputSize = (outputLen - VARSTR_HEADER_SIZE) < bufSize ? (outputLen - VARSTR_HEADER_SIZE + 1): bufSize;
NUM_TO_STRING(inputType, input, outputSize, buf);
int32_t len = (int32_t)strlen(buf);
len = (outputLen - VARSTR_HEADER_SIZE) > len ? len : (outputLen - VARSTR_HEADER_SIZE);