diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index e7f6c7e082..e39935ddf2 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -2308,7 +2308,7 @@ static int32_t tscReissueSubquery(SRetrieveSupport *oriTrs, SSqlObj *pSql, int32 taos_free_result(pSql); return ret; } else { - pSql->pSubs[trsupport->subqueryIndex] = pSql; + pParentSql->pSubs[trsupport->subqueryIndex] = pSql; tscFreeRetrieveSup(pNew); taos_free_result(pNew); return ret;