Merge pull request #11841 from taosdata/fix/TD-15116
fix(query): fix scalar function input is constant return var type value contains illegal characters.
This commit is contained in:
commit
30a255cb93
|
@ -355,7 +355,7 @@ static int32_t translateToIso8601(SFunctionNode* pFunc, char* pErrBuf, int32_t l
|
|||
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
|
||||
}
|
||||
|
||||
pFunc->node.resType = (SDataType) { .bytes = 24, .type = TSDB_DATA_TYPE_BINARY};
|
||||
pFunc->node.resType = (SDataType) { .bytes = 64, .type = TSDB_DATA_TYPE_BINARY};
|
||||
return TSDB_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -489,7 +489,7 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
|
|||
if (fmIsUserDefinedFunc(node->funcId)) {
|
||||
return DEAL_RES_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
FOREACH(tnode, node->pParameterList) {
|
||||
if (!SCL_IS_CONST_NODE(tnode)) {
|
||||
return DEAL_RES_CONTINUE;
|
||||
|
@ -517,8 +517,8 @@ EDealRes sclRewriteFunction(SNode** pNode, SScalarCtx *ctx) {
|
|||
res->node.resType = node->node.resType;
|
||||
int32_t type = output.columnData->info.type;
|
||||
if (IS_VAR_DATA_TYPE(type)) {
|
||||
res->datum.p = output.columnData->pData;
|
||||
output.columnData->pData = NULL;
|
||||
res->datum.p = taosMemoryCalloc(res->node.resType.bytes + VARSTR_HEADER_SIZE + 1, 1);
|
||||
memcpy(res->datum.p, output.columnData->pData, varDataTLen(output.columnData->pData));
|
||||
} else {
|
||||
memcpy(nodesGetValueFromNode(res), output.columnData->pData, tDataTypes[type].bytes);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue