diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 491857a9790e1673e031926be18cfccf04e15492..e39d7c42074a86c73eef62a1c5ec8b60b2ee902c 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -5478,9 +5478,8 @@ int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, in // json key encode by binary char tagKey[TSDB_MAX_JSON_KEY_LEN + VARSTR_HEADER_SIZE] = {0}; - int32_t outLen = 0; strncpy(varDataVal(tagKey), jsonKey, strlen(jsonKey)); - outLen = strlen(jsonKey); + int32_t outLen = (int32_t)strlen(jsonKey); taosHashPut(keyHash, jsonKey, outLen, &outLen, CHAR_BYTES); // add key to hash to remove dumplicate, value is useless varDataSetLen(tagKey, outLen); @@ -5510,9 +5509,9 @@ int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, in tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_BIGINT, tagVal, true); }else if(item->type == cJSON_True || item->type == cJSON_False){ char tagVal[CHAR_BYTES + CHAR_BYTES] = {0}; - *tagVal = jsonType2DbType(item->valueint, item->type); // type + *tagVal = jsonType2DbType((double)(item->valueint), item->type); // type char* tagData = POINTER_SHIFT(tagVal,CHAR_BYTES); - *tagData = item->valueint; + *tagData = (char)(item->valueint); tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_BOOL, tagVal, true); }else if(item->type == cJSON_NULL){ char tagVal[CHAR_BYTES + VARSTR_HEADER_SIZE + INT_BYTES] = {0}; diff --git a/src/util/src/tcompare.c b/src/util/src/tcompare.c index a0499b52418b3a59c3109ea3f2d79332c2dc6f3f..1cfc0c3873a438699c342a7dd4a4b1a8efd32878 100644 --- a/src/util/src/tcompare.c +++ b/src/util/src/tcompare.c @@ -244,8 +244,9 @@ int32_t compareJsonVal(const void *pLeft, const void *pRight) { }else if(type == TSDB_DATA_TYPE_BINARY) { //json null return 0; }else{ - assert(0); + assert(0); } + return 0; } /*