提交 fddf3f16 编写于 作者: X Xiaoyu Wang

fix: udf error check

上级 a0a51187
......@@ -6396,14 +6396,16 @@ static int32_t translateCreateFunction(STranslateContext* pCxt, SCreateFunctionS
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_FUNCTION_NAME);
}
if (TSDB_DATA_TYPE_JSON == pStmt->outputDt.type ||
TSDB_DATA_TYPE_VARBINARY == pStmt->outputDt.type ||
TSDB_DATA_TYPE_DECIMAL == pStmt->outputDt.type ||
TSDB_DATA_TYPE_BLOB == pStmt->outputDt.type ||
if (TSDB_DATA_TYPE_JSON == pStmt->outputDt.type || TSDB_DATA_TYPE_VARBINARY == pStmt->outputDt.type ||
TSDB_DATA_TYPE_DECIMAL == pStmt->outputDt.type || TSDB_DATA_TYPE_BLOB == pStmt->outputDt.type ||
TSDB_DATA_TYPE_MEDIUMBLOB == pStmt->outputDt.type) {
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "Unsupported output type for UDF");
}
if (!pStmt->isAgg && pStmt->bufSize > 0) {
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "BUFSIZE can only be used with UDAF");
}
SCreateFuncReq req = {0};
strcpy(req.name, pStmt->funcName);
req.igExists = pStmt->ignoreExists;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册