commit
8b1dc39c22
|
@ -5427,6 +5427,7 @@ int32_t validateColumnName(char* name) {
|
||||||
|
|
||||||
if (token.type == TK_STRING) {
|
if (token.type == TK_STRING) {
|
||||||
strdequote(token.z);
|
strdequote(token.z);
|
||||||
|
strntolower(token.z, token.z, token.n);
|
||||||
token.n = (uint32_t)strtrim(token.z);
|
token.n = (uint32_t)strtrim(token.z);
|
||||||
|
|
||||||
int32_t k = tSQLGetToken(token.z, &token.type);
|
int32_t k = tSQLGetToken(token.z, &token.type);
|
||||||
|
|
|
@ -32,6 +32,14 @@
|
||||||
static void freeQueryInfoImpl(SQueryInfo* pQueryInfo);
|
static void freeQueryInfoImpl(SQueryInfo* pQueryInfo);
|
||||||
static void clearAllTableMetaInfo(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) {
|
SCond* tsGetSTableQueryCond(STagCond* pTagCond, uint64_t uid) {
|
||||||
if (pTagCond->pCond == NULL) {
|
if (pTagCond->pCond == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1413,9 +1421,11 @@ int32_t tscValidateName(SStrToken* pToken) {
|
||||||
char* sep = strnchr(pToken->z, TS_PATH_DELIMITER[0], pToken->n, true);
|
char* sep = strnchr(pToken->z, TS_PATH_DELIMITER[0], pToken->n, true);
|
||||||
if (sep == NULL) { // single part
|
if (sep == NULL) { // single part
|
||||||
if (pToken->type == TK_STRING) {
|
if (pToken->type == TK_STRING) {
|
||||||
|
|
||||||
strdequote(pToken->z);
|
strdequote(pToken->z);
|
||||||
|
tscStrToLower(pToken->z, pToken->n);
|
||||||
pToken->n = (uint32_t)strtrim(pToken->z);
|
pToken->n = (uint32_t)strtrim(pToken->z);
|
||||||
|
|
||||||
int len = tSQLGetToken(pToken->z, &pToken->type);
|
int len = tSQLGetToken(pToken->z, &pToken->type);
|
||||||
|
|
||||||
// single token, validate it
|
// single token, validate it
|
||||||
|
@ -1467,7 +1477,7 @@ int32_t tscValidateName(SStrToken* pToken) {
|
||||||
if (pToken->type == TK_STRING && validateQuoteToken(pToken) != TSDB_CODE_SUCCESS) {
|
if (pToken->type == TK_STRING && validateQuoteToken(pToken) != TSDB_CODE_SUCCESS) {
|
||||||
return TSDB_CODE_TSC_INVALID_SQL;
|
return TSDB_CODE_TSC_INVALID_SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// re-build the whole name string
|
// re-build the whole name string
|
||||||
if (pStr[firstPartLen] == TS_PATH_DELIMITER[0]) {
|
if (pStr[firstPartLen] == TS_PATH_DELIMITER[0]) {
|
||||||
// first part do not have quote do nothing
|
// first part do not have quote do nothing
|
||||||
|
@ -1479,6 +1489,8 @@ int32_t tscValidateName(SStrToken* pToken) {
|
||||||
}
|
}
|
||||||
pToken->n += (firstPartLen + sizeof(TS_PATH_DELIMITER[0]));
|
pToken->n += (firstPartLen + sizeof(TS_PATH_DELIMITER[0]));
|
||||||
pToken->z = pStr;
|
pToken->z = pStr;
|
||||||
|
|
||||||
|
tscStrToLower(pToken->z,pToken->n);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
|
|
|
@ -26,11 +26,11 @@ sql use ' XYZ '
|
||||||
|
|
||||||
sql drop database 'abc123'
|
sql drop database 'abc123'
|
||||||
sql drop database '_ab1234'
|
sql drop database '_ab1234'
|
||||||
sql drop database 'ABC123'
|
sql_error drop database 'ABC123'
|
||||||
sql drop database '_ABC123'
|
sql drop database '_ABC123'
|
||||||
sql drop database 'aABb123'
|
sql drop database 'aABb123'
|
||||||
sql drop database ' xyz '
|
sql drop database ' xyz '
|
||||||
sql drop database ' XYZ '
|
sql_error drop database ' XYZ '
|
||||||
|
|
||||||
|
|
||||||
sql use abc
|
sql use abc
|
||||||
|
@ -67,9 +67,9 @@ sql describe mt
|
||||||
sql describe sub_001
|
sql describe sub_001
|
||||||
sql describe sub_dy_tbl
|
sql describe sub_dy_tbl
|
||||||
|
|
||||||
sql_error describe Dd
|
sql describe Dd
|
||||||
sql_error describe FF
|
sql describe FF
|
||||||
sql_error describe gG
|
sql describe gG
|
||||||
|
|
||||||
sql drop table abc.cc
|
sql drop table abc.cc
|
||||||
sql drop table 'abc.Dd'
|
sql drop table 'abc.Dd'
|
||||||
|
@ -119,4 +119,4 @@ if $rows != 4 then
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
|
||||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||||
|
|
Loading…
Reference in New Issue