Merge pull request #7654 from taosdata/fix/TD-6361
[TD-6361]<fix> restrict UDF func name
This commit is contained in:
commit
8c96539b01
|
@ -430,7 +430,7 @@ int32_t readFromFile(char *name, uint32_t *len, void **buf) {
|
|||
|
||||
|
||||
int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||
const char *msg1 = "function name is too long";
|
||||
const char *msg1 = "invalidate function name";
|
||||
const char *msg2 = "path is too long";
|
||||
const char *msg3 = "invalid outputtype";
|
||||
const char *msg4 = "invalid script";
|
||||
|
@ -447,7 +447,10 @@ int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
|||
}
|
||||
|
||||
createInfo->name.z[createInfo->name.n] = 0;
|
||||
|
||||
// funcname's naming rule is same to column
|
||||
if (validateColumnName(createInfo->name.z) != TSDB_CODE_SUCCESS) {
|
||||
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
||||
}
|
||||
strdequote(createInfo->name.z);
|
||||
|
||||
if (strlen(createInfo->name.z) >= TSDB_FUNC_NAME_LEN) {
|
||||
|
|
Loading…
Reference in New Issue