diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index a6fe3fa077..41f2a54892 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -566,7 +566,6 @@ static int32_t tscLaunchRealSubqueries(SSqlObj* pSql) { break; } - tscClearSubqueryInfo(&pNew->cmd); pSql->pSubs[i] = pNew; @@ -1878,6 +1877,7 @@ int32_t tscCreateJoinSubquery(SSqlObj *pSql, int16_t tableIndex, SJoinSupporter pNewQueryInfo->limit.limit = -1; pNewQueryInfo->limit.offset = 0; + taosArrayDestroy(pNewQueryInfo->pUpstream); pNewQueryInfo->order.orderColId = INT32_MIN; diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 0ae51284be..f44edf7503 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6447,6 +6447,7 @@ int32_t createQueryFunc(SQueriedTableInfo* pTableInfo, int32_t numOfOutput, SExp return TSDB_CODE_SUCCESS; } +// todo refactor int32_t createIndirectQueryFuncExprFromMsg(SQueryTableMsg* pQueryMsg, int32_t numOfOutput, SExprInfo** pExprInfo, SSqlExpr** pExpr, SExprInfo* prevExpr) { *pExprInfo = NULL; @@ -6461,6 +6462,12 @@ int32_t createIndirectQueryFuncExprFromMsg(SQueryTableMsg* pQueryMsg, int32_t nu for (int32_t i = 0; i < numOfOutput; ++i) { pExprs[i].base = *pExpr[i]; + memset(pExprs[i].base.param, 0, sizeof(tVariant) * tListLen(pExprs[i].base.param)); + + for (int32_t j = 0; j < pExpr[i]->numOfParams; ++j) { + tVariantAssign(&pExprs[i].base.param[j], &pExpr[i]->param[j]); + } + pExprs[i].base.resType = 0; int16_t type = 0;