diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 01691249c102340519e1d8bf26107d19eed19db1..c431a731c0dd23db8eaf34ded0715d90fb709819 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -3014,6 +3014,10 @@ int32_t tscValidateName(SStrToken* pToken, bool escapeEnabled, bool *dbIncluded) // single token, validate it if (len == pToken->n) { + if (taosIsKeyWordToken(pToken->z, (int32_t) pToken->n)) { + return TSDB_CODE_TSC_INVALID_OPERATION; + } + return validateQuoteToken(pToken, escapeEnabled, NULL); } else { sep = strnchr(pToken->z, TS_PATH_DELIMITER[0], pToken->n, true); diff --git a/tests/pytest/query/queryBase.py b/tests/pytest/query/queryBase.py index 4544fab3adcb6e760dcbc05ab56cd22edd35b3e2..9be950df49e7b2e34f88edaafd91fac37aa8a009 100644 --- a/tests/pytest/query/queryBase.py +++ b/tests/pytest/query/queryBase.py @@ -171,6 +171,11 @@ class TDTestCase: tdSql.waitedQuery(sql, 1, WAITS) tdSql.checkData(0, 1, 229400) + # TS-1664 + tdSql.error("create database string") + tdSql.error("create table string(ts timestamp, c1 int)") + tdSql.error("select * from string") + # # add case with filename #