fix: udf error check
This commit is contained in:
parent
a0a51187bf
commit
fddf3f16cf
|
@ -6396,14 +6396,16 @@ static int32_t translateCreateFunction(STranslateContext* pCxt, SCreateFunctionS
|
||||||
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_FUNCTION_NAME);
|
return generateSyntaxErrMsg(&pCxt->msgBuf, TSDB_CODE_PAR_INVALID_FUNCTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (TSDB_DATA_TYPE_JSON == pStmt->outputDt.type ||
|
if (TSDB_DATA_TYPE_JSON == pStmt->outputDt.type || TSDB_DATA_TYPE_VARBINARY == 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_DECIMAL == pStmt->outputDt.type ||
|
|
||||||
TSDB_DATA_TYPE_BLOB == pStmt->outputDt.type ||
|
|
||||||
TSDB_DATA_TYPE_MEDIUMBLOB == pStmt->outputDt.type) {
|
TSDB_DATA_TYPE_MEDIUMBLOB == pStmt->outputDt.type) {
|
||||||
return generateSyntaxErrMsgExt(&pCxt->msgBuf, TSDB_CODE_PAR_SYNTAX_ERROR, "Unsupported output type for UDF");
|
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};
|
SCreateFuncReq req = {0};
|
||||||
strcpy(req.name, pStmt->funcName);
|
strcpy(req.name, pStmt->funcName);
|
||||||
req.igExists = pStmt->ignoreExists;
|
req.igExists = pStmt->ignoreExists;
|
||||||
|
|
Loading…
Reference in New Issue