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

TD-6129<feature> fix json encode error

上级 15e208a1
...@@ -1106,7 +1106,7 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable, bool refSuper ...@@ -1106,7 +1106,7 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable, bool refSuper
continue; continue;
} }
SArray** tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val) ,varDataLen(val)); void* tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val) ,varDataLen(val));
if(tablist == NULL) { if(tablist == NULL) {
void* tablistNew = taosArrayInit(8, sizeof(JsonMapValue)); void* tablistNew = taosArrayInit(8, sizeof(JsonMapValue));
if(tablistNew == NULL){ if(tablistNew == NULL){
...@@ -1119,11 +1119,11 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable, bool refSuper ...@@ -1119,11 +1119,11 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable, bool refSuper
tsdbError("out of memory when put json tag array"); tsdbError("out of memory when put json tag array");
return -1; return -1;
} }
tablist = (SArray**)&tablistNew; tablist = tablistNew;
} }
JsonMapValue jmvalue = {TABLE_UID(pTable), pColIdx->colId}; JsonMapValue jmvalue = {TABLE_UID(pTable), pColIdx->colId};
taosArrayAddBatch(*tablist, &jmvalue, 1); taosArrayPush(tablist, &jmvalue);
taosArraySort(*tablist, tscCompareJsonMapValue); taosArraySort(tablist, tscCompareJsonMapValue);
} }
}else{ }else{
tSkipListPut(pSTable->pIndex, (void *)pTable); tSkipListPut(pSTable->pIndex, (void *)pTable);
...@@ -1153,19 +1153,19 @@ static int tsdbRemoveTableFromIndex(STsdbMeta *pMeta, STable *pTable) { ...@@ -1153,19 +1153,19 @@ static int tsdbRemoveTableFromIndex(STsdbMeta *pMeta, STable *pTable) {
continue; continue;
} }
SArray** tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val) ,varDataLen(val)); void* tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val) ,varDataLen(val));
if(tablist == NULL) { if(tablist == NULL) {
tsdbError("json tag no key error,%d", j); tsdbError("json tag no key error,%d", j);
continue; continue;
} }
JsonMapValue jmvalue = {TABLE_UID(pTable), pColIdx->colId}; JsonMapValue jmvalue = {TABLE_UID(pTable), pColIdx->colId};
void* p = taosArraySearch(*tablist, &jmvalue, tscCompareJsonMapValue, TD_EQ); void* p = taosArraySearch(tablist, &jmvalue, tscCompareJsonMapValue, TD_EQ);
if (p == NULL) { if (p == NULL) {
tsdbError("json tag no tableid error,%d", j); tsdbError("json tag no tableid error,%d", j);
continue; continue;
} }
taosArrayRemove(*tablist, TARRAY_ELEM_IDX(*tablist, p)); taosArrayRemove(tablist, TARRAY_ELEM_IDX((SArray*)tablist, p));
} }
}else { }else {
char * key = getTagIndexKey(pTable); char * key = getTagIndexKey(pTable);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册