提交 83eef6f5 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> fix json encode error

上级 4784958a
......@@ -5203,7 +5203,7 @@ char* parseTagDatatoJson(void *p){
}else{ // json value
char tagJsonValue[TSDB_MAX_TAGS_LEN] = {0};
if(*(char*)val == cJSON_String){
int32_t length = taosUcs4ToMbs(varDataVal(val + CHAR_BYTES), varDataLen(val + CHAR_BYTES), tagJsonValue);
int32_t length = taosUcs4ToMbs(varDataVal(POINTER_SHIFT(val,CHAR_BYTES)), varDataLen(POINTER_SHIFT(val,CHAR_BYTES)), tagJsonValue);
if (length == 0) {
tscError("charset:%s to %s. val:%s convert json value failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, (char*)val);
goto end;
......@@ -5215,7 +5215,7 @@ char* parseTagDatatoJson(void *p){
}
cJSON_AddItemToObject(json, tagJsonKey, value);
}else if(*(char*)val == cJSON_Number){
double jsonVd = *(double*)(val + CHAR_BYTES);
double jsonVd = *(double*)(POINTER_SHIFT(val,CHAR_BYTES));
cJSON* value = cJSON_CreateNumber(jsonVd);
if (value == NULL)
{
......
......@@ -212,7 +212,7 @@ void *tsdbGetTableTagVal(const void* pTable, int32_t colId, int16_t type, int16_
char *val = NULL;
if (type == TSDB_DATA_TYPE_JSON){
val = kvRowValues(((STable*)pTable)->tagVal);
val = ((STable*)pTable)->tagVal;
}else{
val = tdGetKVRowValOfCol(((STable*)pTable)->tagVal, colId);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册