diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 4780998785..db43a6776e 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -46,6 +46,13 @@ static int32_t tsCompare(int32_t order, int64_t left, int64_t right) { } static void skipRemainValue(STSBuf* pTSBuf, tVariant* tag1) { + STSElem el1 = tsBufGetElem(pTSBuf); + + int32_t res = tVariantCompare(el1.tag, tag1); + if (res != 0) { // it is a record with new tag + return; + } + while (tsBufNextPos(pTSBuf)) { STSElem el1 = tsBufGetElem(pTSBuf);