未验证 提交 b5a87a3c 编写于 作者: S shenglian-zhou 提交者: GitHub

Merge pull request #11201 from taosdata/szhou/nchar-scalar-coredump

TD-14454: allocate enough memory space for mbs to ucs4 conversion
...@@ -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 + VARSTR_HEADER_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;
...@@ -956,7 +956,7 @@ int32_t exprValidateStringConcatNode(tExprNode *pExpr) { ...@@ -956,7 +956,7 @@ int32_t exprValidateStringConcatNode(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);
...@@ -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);
......
此差异已折叠。
...@@ -797,6 +797,7 @@ ...@@ -797,6 +797,7 @@
3,,pytest,python3 test.py -f query/filterAllIntTypes.py 3,,pytest,python3 test.py -f query/filterAllIntTypes.py
3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py 3,,develop-test,python3 ./test.py -f 2-query/ts_hidden_column.py
3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py 3,,develop-test,python3 ./test.py -f 2-query/ts_shortcut.py
3,,develop-test,python3 ./test.py -f 2-query/nchar_funcs.py
3,,develop-test,python3 ./test.py -f 2-query/TD-5902.py 3,,develop-test,python3 ./test.py -f 2-query/TD-5902.py
1,,develop-test,python3 ./test.py -f 2-query/TD-14196.py 1,,develop-test,python3 ./test.py -f 2-query/TD-14196.py
3,,script,./test.sh -f general/compute/scalar_str_concat_len.sim 3,,script,./test.sh -f general/compute/scalar_str_concat_len.sim
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册