From bb908a9b336c979ed67bb87dfbdc8e3973b7960c Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 25 Oct 2022 13:45:10 +0800 Subject: [PATCH] fix(query): alter user with tag filter check valid --- src/client/src/tscSQLParser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index ff660a2498..2651d6657d 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -862,6 +862,7 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { const char* msg3 = "name too long"; const char* msg5 = "invalid user rights"; const char* msg7 = "not support options"; + const char* msg8 = "tags filter string length must less than 255 bytes."; pCmd->command = pInfo->type; @@ -900,6 +901,9 @@ int32_t tscValidateSqlInfo(SSqlObj* pSql, struct SSqlInfo* pInfo) { } else { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg5); } + } else if (pUser->type == TSDB_ALTER_USER_TAGS) { + SStrToken* pTags = &pUser->tags; + if (pTags->n < 4) return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg8); } else { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7); } -- GitLab