diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index f33e1e292e9a583fc8d9405041c83b5c9a166a3b..c46662097b734da70e67d5b7511991f529b17d67 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -32,6 +32,14 @@ static void freeQueryInfoImpl(SQueryInfo* pQueryInfo); static void clearAllTableMetaInfo(SQueryInfo* pQueryInfo); +static void tscStrToLower(char *str, int32_t n) { + if (str == NULL || n <= 0) { return;} + for (int32_t i = 0; i < n; i++) { + if (str[i] >= 'A' && str[i] <= 'Z') { + str[i] -= ('A' - 'a'); + } + } +} SCond* tsGetSTableQueryCond(STagCond* pTagCond, uint64_t uid) { if (pTagCond->pCond == NULL) { return NULL; @@ -1422,7 +1430,7 @@ int32_t tscValidateName(SStrToken* pToken) { if (pToken->type == TK_STRING) { strdequote(pToken->z); - strntolower(pToken->z, pToken->z, pToken->n); + tscStrToLower(pToken->z, pToken->n); pToken->n = (uint32_t)strtrim(pToken->z); int len = tSQLGetToken(pToken->z, &pToken->type); @@ -1477,8 +1485,6 @@ int32_t tscValidateName(SStrToken* pToken) { return TSDB_CODE_TSC_INVALID_SQL; } - strntolower(pToken->z, pToken->z, pToken->n); - // re-build the whole name string if (pStr[firstPartLen] == TS_PATH_DELIMITER[0]) { // first part do not have quote do nothing @@ -1491,7 +1497,7 @@ int32_t tscValidateName(SStrToken* pToken) { pToken->n += (firstPartLen + sizeof(TS_PATH_DELIMITER[0])); pToken->z = pStr; - strntolower(pToken->z, pToken->z, pToken->n); + tscStrToLower(pToken->z,pToken->n); } return TSDB_CODE_SUCCESS;