fix(query): restrict using JSON type as input in string functions

TD-18664
This commit is contained in:
Ganlin Zhao 2022-08-26 16:15:08 +08:00
parent ab85eeaaaa
commit 0fbb4d7f9a
1 changed files with 1 additions and 2 deletions

View File

@ -1682,8 +1682,7 @@ static int32_t translateLength(SFunctionNode* pFunc, char* pErrBuf, int32_t len)
return invaildFuncParaNumErrMsg(pErrBuf, len, pFunc->functionName);
}
uint8_t paraType = ((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type;
if (!IS_STR_DATA_TYPE(paraType)) {
if (!IS_STR_DATA_TYPE(((SExprNode*)nodesListGetNode(pFunc->pParameterList, 0))->resType.type)) {
return invaildFuncParaTypeErrMsg(pErrBuf, len, pFunc->functionName);
}