diff --git a/source/dnode/mnode/impl/src/mndConsumer.c b/source/dnode/mnode/impl/src/mndConsumer.c index 1aa2fa997b..4bad0e8563 100644 --- a/source/dnode/mnode/impl/src/mndConsumer.c +++ b/source/dnode/mnode/impl/src/mndConsumer.c @@ -626,7 +626,7 @@ static int32_t mndProcessSubscribeReq(SRpcMsg *pMsg) { } else { char *oldTopic = taosArrayGetP(pConsumerOld->currentTopics, i); char *newTopic = taosArrayGetP(newSub, j); - int comp = compareLenPrefixedStr(oldTopic, newTopic); + int comp = strcmp(oldTopic, newTopic); if (comp == 0) { i++; j++; diff --git a/source/util/src/tarray.c b/source/util/src/tarray.c index 64701574bb..8da9746b02 100644 --- a/source/util/src/tarray.c +++ b/source/util/src/tarray.c @@ -133,13 +133,14 @@ void taosArrayRemoveDuplicate(SArray* pArray, __compar_fn_t comparFn, void (*fp) // do nothing } else { if (pos + 1 != i) { - void* p = taosArrayGet(pArray, pos + 1); + void* p = taosArrayGetp(pArray, pos + 1); if (fp != NULL) { fp(p); } taosArraySet(pArray, pos + 1, p2); - pos += 1; + memset(TARRAY_GET_ELEM(pArray, i), 0, pArray->elemSize); + pos += 1; } else { pos += 1; } diff --git a/source/util/src/tcompare.c b/source/util/src/tcompare.c index 7a52991e81..46a9051436 100644 --- a/source/util/src/tcompare.c +++ b/source/util/src/tcompare.c @@ -1232,7 +1232,7 @@ int32_t taosArrayCompareString(const void *a, const void *b) { const char *x = *(const char **)a; const char *y = *(const char **)b; - return compareLenPrefixedStr(x, y); + return strcmp(x, y); } int32_t comparestrPatternMatch(const void *pLeft, const void *pRight) {