diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index b7543cb42dcc24e3d5aa30c8b0769c7a6ddc22c4..f63b18c277adeb6fd12c1f08013bf1ad09869f06 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -1878,7 +1878,8 @@ static void do_top_function_add(STopBotInfo *pInfo, int32_t maxLen, void *pData, tVariantCreateFromBinary(&val, pData, tDataTypeDesc[type].nSize, type); tValuePair **pList = pInfo->res; - + assert(pList != NULL); + if (pInfo->num < maxLen) { if (pInfo->num == 0 || ((type >= TSDB_DATA_TYPE_TINYINT && type <= TSDB_DATA_TYPE_BIGINT) && diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c index 2ba38d3e9e46ce479c9fde74161a45f980da6a41..33fb3fe760de8b6dc27079d8da231b4291fc2c7e 100644 --- a/src/system/detail/src/vnodeQueryImpl.c +++ b/src/system/detail/src/vnodeQueryImpl.c @@ -4461,6 +4461,8 @@ int32_t vnodeQuerySingleMeterPrepare(SQInfo *pQInfo, SMeterObj *pMeterObj, SMete // the pQuery->skey is changed during normalizedFirstQueryRange, so set the newest lastkey value pQuery->lastKey = pQuery->skey; + pRuntimeEnv->stableQuery = false; + return TSDB_CODE_SUCCESS; } @@ -4600,7 +4602,8 @@ int32_t vnodeMultiMeterQueryPrepare(SQInfo *pQInfo, SQuery *pQuery, void *param) TSKEY revisedStime = taosGetIntervalStartTimestamp(pSupporter->rawSKey, pQuery->nAggTimeInterval, pQuery->intervalTimeUnit, pQuery->precision); taosInitInterpoInfo(&pRuntimeEnv->interpoInfo, pQuery->order.order, revisedStime, 0, 0); - + pRuntimeEnv->stableQuery = true; + return TSDB_CODE_SUCCESS; }