提交 a607a0ff 编写于 作者: S shenglian zhou

allocate enough memory space for mbs to ucs4 conversion

上级 1da436ab
...@@ -439,7 +439,7 @@ void exprTreeFunctionNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOper ...@@ -439,7 +439,7 @@ void exprTreeFunctionNodeTraverse(tExprNode *pExpr, int32_t numOfRows, tExprOper
} }
pInputs[i].numOfRows = (int16_t)numOfRows; pInputs[i].numOfRows = (int16_t)numOfRows;
} else if (pChild->nodeType == TSQL_NODE_VALUE) { } else if (pChild->nodeType == TSQL_NODE_VALUE) {
pChildrenOutput[i] = malloc(pChild->resultBytes); pChildrenOutput[i] = malloc((pChild->resultBytes+1)*TSDB_NCHAR_SIZE);
tVariantDump(pChild->pVal, pChildrenOutput[i], pChild->resultType, true); tVariantDump(pChild->pVal, pChildrenOutput[i], pChild->resultType, true);
pInputs[i].data = pChildrenOutput[i]; pInputs[i].data = pChildrenOutput[i];
pInputs[i].numOfRows = 1; pInputs[i].numOfRows = 1;
...@@ -1028,7 +1028,7 @@ int32_t exprValidateStringConcatWsNode(tExprNode *pExpr) { ...@@ -1028,7 +1028,7 @@ int32_t exprValidateStringConcatWsNode(tExprNode *pExpr) {
if (!IS_VAR_DATA_TYPE(child->pVal->nType)) { if (!IS_VAR_DATA_TYPE(child->pVal->nType)) {
return TSDB_CODE_TSC_INVALID_OPERATION; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
char* payload = malloc(child->pVal->nLen * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE); char* payload = malloc((child->pVal->nLen+1) * TSDB_NCHAR_SIZE + VARSTR_HEADER_SIZE);
tVariantDump(child->pVal, payload, resultType, true); tVariantDump(child->pVal, payload, resultType, true);
int16_t resultBytes = varDataTLen(payload); int16_t resultBytes = varDataTLen(payload);
free(payload); free(payload);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册