[TD-6361]<fix> restrict UDF func name
This commit is contained in:
parent
a8d688a745
commit
b48c2c9c10
|
@ -432,7 +432,7 @@ int32_t readFromFile(char *name, uint32_t *len, void **buf) {
|
||||||
|
|
||||||
|
|
||||||
int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
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 *msg2 = "path is too long";
|
||||||
const char *msg3 = "invalid outputtype";
|
const char *msg3 = "invalid outputtype";
|
||||||
const char *msg4 = "invalid script";
|
const char *msg4 = "invalid script";
|
||||||
|
@ -449,7 +449,10 @@ int32_t handleUserDefinedFunc(SSqlObj* pSql, struct SSqlInfo* pInfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
createInfo->name.z[createInfo->name.n] = 0;
|
createInfo->name.z[createInfo->name.n] = 0;
|
||||||
|
// funcname's naming rule is same to column
|
||||||
|
if (!validateColumnName(createInfo->name.z)) {
|
||||||
|
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg1);
|
||||||
|
}
|
||||||
strdequote(createInfo->name.z);
|
strdequote(createInfo->name.z);
|
||||||
|
|
||||||
if (strlen(createInfo->name.z) >= TSDB_FUNC_NAME_LEN) {
|
if (strlen(createInfo->name.z) >= TSDB_FUNC_NAME_LEN) {
|
||||||
|
|
Loading…
Reference in New Issue