提交 7f3204ce 编写于 作者: X xywang

fix: database name which is a key word should not permitted

上级 8b944e21
...@@ -1511,7 +1511,6 @@ int32_t tscSetTableFullName(SName* pName, SStrToken* pTableName, SSqlObj* pSql, ...@@ -1511,7 +1511,6 @@ int32_t tscSetTableFullName(SName* pName, SStrToken* pTableName, SSqlObj* pSql,
const char* msg4 = "db name too long"; const char* msg4 = "db name too long";
const char* msg5 = "table name too long"; const char* msg5 = "table name too long";
const char* msg6 = "table name empty"; const char* msg6 = "table name empty";
const char* msg7 = "invalid table name";
SSqlCmd* pCmd = &pSql->cmd; SSqlCmd* pCmd = &pSql->cmd;
int32_t code = TSDB_CODE_SUCCESS; int32_t code = TSDB_CODE_SUCCESS;
...@@ -1576,15 +1575,6 @@ int32_t tscSetTableFullName(SName* pName, SStrToken* pTableName, SSqlObj* pSql, ...@@ -1576,15 +1575,6 @@ int32_t tscSetTableFullName(SName* pName, SStrToken* pTableName, SSqlObj* pSql,
} }
} }
if (code != 0) {
return code;
}
bool ret = taosIsKeyWordToken(pName->tname, (int32_t) strlen(pName->tname));
if (ret) {
code = invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg7);
}
return code; return code;
} }
......
...@@ -3014,8 +3014,8 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) ...@@ -3014,8 +3014,8 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded)
// single token, validate it // single token, validate it
if (len == pToken->n) { if (len == pToken->n) {
if (strncmp(pToken->z, "string", len) == 0) { if (taosIsKeyWordToken(pToken->z, (int32_t) pToken->n)) {
return TSDB_CODE_SUCCESS; return TSDB_CODE_TSC_INVALID_OPERATION;
} }
return validateQuoteToken(pToken, escapeEnabled, NULL); return validateQuoteToken(pToken, escapeEnabled, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册