提交 e083d000 编写于 作者: G Ganlin Zhao

[TD-10897]<fix>: SchemaLess : Schemaless will auto convert Convert uppercase letters to lowercase

上级 aa87acae
...@@ -65,7 +65,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index, ...@@ -65,7 +65,7 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index,
} }
} }
pSml->stableName[len] = tolower(*cur); pSml->stableName[len] = *cur;
cur++; cur++;
len++; len++;
...@@ -240,7 +240,6 @@ static int32_t parseTelnetTagKey(TAOS_SML_KV *pKV, const char **index, SHashObj ...@@ -240,7 +240,6 @@ static int32_t parseTelnetTagKey(TAOS_SML_KV *pKV, const char **index, SHashObj
pKV->key = tcalloc(len + TS_ESCAPE_CHAR_SIZE + 1, 1); pKV->key = tcalloc(len + TS_ESCAPE_CHAR_SIZE + 1, 1);
memcpy(pKV->key, key, len + 1); memcpy(pKV->key, key, len + 1);
strntolower_s(pKV->key, pKV->key, (int32_t)len);
addEscapeCharToString(pKV->key, len); addEscapeCharToString(pKV->key, len);
//tscDebug("OTD:0x%"PRIx64" Key:%s|len:%d", info->id, pKV->key, len); //tscDebug("OTD:0x%"PRIx64" Key:%s|len:%d", info->id, pKV->key, len);
*index = cur + 1; *index = cur + 1;
...@@ -326,7 +325,6 @@ static int32_t parseTelnetTagKvs(TAOS_SML_KV **pKVs, int *num_kvs, ...@@ -326,7 +325,6 @@ static int32_t parseTelnetTagKvs(TAOS_SML_KV **pKVs, int *num_kvs,
*childTableName = tcalloc(pkv->length + TS_ESCAPE_CHAR_SIZE + 1, 1); *childTableName = tcalloc(pkv->length + TS_ESCAPE_CHAR_SIZE + 1, 1);
memcpy(*childTableName, pkv->value, pkv->length); memcpy(*childTableName, pkv->value, pkv->length);
(*childTableName)[pkv->length] = '\0'; (*childTableName)[pkv->length] = '\0';
strntolower_s(*childTableName, *childTableName, (int32_t)pkv->length);
addEscapeCharToString(*childTableName, pkv->length); addEscapeCharToString(*childTableName, pkv->length);
tfree(pkv->key); tfree(pkv->key);
tfree(pkv->value); tfree(pkv->value);
...@@ -514,7 +512,6 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL ...@@ -514,7 +512,6 @@ static int32_t parseMetricFromJSON(cJSON *root, TAOS_SML_DATA_POINT* pSml, SSmlL
*/ */
tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1); tstrncpy(pSml->stableName, metric->valuestring, stableLen + 1);
strntolower_s(pSml->stableName, pSml->stableName, (int32_t)stableLen);
addEscapeCharToString(pSml->stableName, (int32_t)stableLen); addEscapeCharToString(pSml->stableName, (int32_t)stableLen);
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
...@@ -545,7 +542,6 @@ static int32_t parseTimestampFromJSONObj(cJSON *root, int64_t *tsVal, SSmlLinesI ...@@ -545,7 +542,6 @@ static int32_t parseTimestampFromJSONObj(cJSON *root, int64_t *tsVal, SSmlLinesI
} }
size_t typeLen = strlen(type->valuestring); size_t typeLen = strlen(type->valuestring);
strntolower_s(type->valuestring, type->valuestring, (int32_t)typeLen);
if (typeLen == 1 && type->valuestring[0] == 's') { if (typeLen == 1 && type->valuestring[0] == 's') {
//seconds //seconds
*tsVal = (int64_t)(*tsVal * 1e9); *tsVal = (int64_t)(*tsVal * 1e9);
...@@ -913,7 +909,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, ...@@ -913,7 +909,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs,
size_t idLen = strlen(id->valuestring); size_t idLen = strlen(id->valuestring);
*childTableName = tcalloc(idLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char)); *childTableName = tcalloc(idLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
memcpy(*childTableName, id->valuestring, idLen); memcpy(*childTableName, id->valuestring, idLen);
strntolower_s(*childTableName, *childTableName, (int32_t)idLen);
addEscapeCharToString(*childTableName, (int32_t)idLen); addEscapeCharToString(*childTableName, (int32_t)idLen);
//check duplicate IDs //check duplicate IDs
...@@ -952,7 +947,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, ...@@ -952,7 +947,6 @@ static int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs,
} }
pkv->key = tcalloc(keyLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char)); pkv->key = tcalloc(keyLen + TS_ESCAPE_CHAR_SIZE + 1, sizeof(char));
strncpy(pkv->key, tag->string, keyLen); strncpy(pkv->key, tag->string, keyLen);
strntolower_s(pkv->key, pkv->key, (int32_t)keyLen);
addEscapeCharToString(pkv->key, (int32_t)keyLen); addEscapeCharToString(pkv->key, (int32_t)keyLen);
//value //value
ret = parseValueFromJSON(tag, pkv, info); ret = parseValueFromJSON(tag, pkv, info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册