fix varchr len issue

This commit is contained in:
dapan1121 2022-05-23 17:09:03 +08:00
parent 5fc9aa5ec1
commit 741ec2f5ac
1 changed files with 1 additions and 1 deletions

View File

@ -2177,7 +2177,7 @@ static int32_t jsonToDatum(const SJson* pJson, void* pObj) {
code = TSDB_CODE_OUT_OF_MEMORY;
break;
}
varDataSetLen(pNode->datum.p, pNode->node.resType.bytes);
varDataSetLen(pNode->datum.p, pNode->node.resType.bytes - VARSTR_HEADER_SIZE);
if (TSDB_DATA_TYPE_NCHAR == pNode->node.resType.type) {
char* buf = taosMemoryCalloc(1, pNode->node.resType.bytes * 2 + VARSTR_HEADER_SIZE + 1);
if (NULL == buf) {