提交 74e801a4 编写于 作者: B Benguang Zhao

fix: Case sensitive comparison of field names (#TS-1609)

上级 c8946cdd
...@@ -1857,7 +1857,7 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) { ...@@ -1857,7 +1857,7 @@ int32_t validateOneColumn(SSqlCmd* pCmd, TAOS_FIELD* pColField) {
// field name must be unique // field name must be unique
for (int32_t i = 0; i < numOfTags + numOfCols; ++i) { for (int32_t i = 0; i < numOfTags + numOfCols; ++i) {
if (strncasecmp(pColField->name, pSchema[i].name, sizeof(pColField->name) - 1) == 0) { if (strncmp(pColField->name, pSchema[i].name, sizeof(pColField->name) - 1) == 0) {
//return tscErrorMsgWithCode(TSDB_CODE_TSC_DUP_COL_NAMES, tscGetErrorMsgPayload(pCmd), pColField->name, NULL); //return tscErrorMsgWithCode(TSDB_CODE_TSC_DUP_COL_NAMES, tscGetErrorMsgPayload(pCmd), pColField->name, NULL);
return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "duplicated column names"); return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), "duplicated column names");
} }
......
...@@ -1235,7 +1235,7 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) { ...@@ -1235,7 +1235,7 @@ static int32_t mnodeProcessDropSuperTableMsg(SMnodeMsg *pMsg) {
static int32_t mnodeFindSuperTableTagIndex(SSTableObj *pStable, const char *tagName) { static int32_t mnodeFindSuperTableTagIndex(SSTableObj *pStable, const char *tagName) {
SSchema *schema = (SSchema *) pStable->schema; SSchema *schema = (SSchema *) pStable->schema;
for (int32_t tag = 0; tag < pStable->numOfTags; tag++) { for (int32_t tag = 0; tag < pStable->numOfTags; tag++) {
if (strcasecmp(schema[pStable->numOfColumns + tag].name, tagName) == 0) { if (strcmp(schema[pStable->numOfColumns + tag].name, tagName) == 0) {
return tag; return tag;
} }
} }
...@@ -1388,7 +1388,7 @@ static int32_t mnodeModifySuperTableTagName(SMnodeMsg *pMsg, char *oldTagName, c ...@@ -1388,7 +1388,7 @@ static int32_t mnodeModifySuperTableTagName(SMnodeMsg *pMsg, char *oldTagName, c
static int32_t mnodeFindSuperTableColumnIndex(SSTableObj *pStable, char *colName) { static int32_t mnodeFindSuperTableColumnIndex(SSTableObj *pStable, char *colName) {
SSchema *schema = (SSchema *) pStable->schema; SSchema *schema = (SSchema *) pStable->schema;
for (int32_t col = 0; col < pStable->numOfColumns; col++) { for (int32_t col = 0; col < pStable->numOfColumns; col++) {
if (strcasecmp(schema[col].name, colName) == 0) { if (strcmp(schema[col].name, colName) == 0) {
return col; return col;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册