diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 09574e741fe751a1aa7784d8774fa6334a1f1b2c..1805c22a9d77181fd5d5e2b3f31a25186741ac74 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -101,13 +101,12 @@ static bool allSubqueryDone(SSqlObj *pParentSql) { bool subAndCheckDone(SSqlObj *pSql, SSqlObj *pParentSql, int idx) { SSubqueryState *subState = &pParentSql->subState; - assert(idx < subState->numOfSub); pthread_mutex_lock(&subState->mutex); - - tscDebug("0x%"PRIx64" subquery:0x%"PRIx64", idx:%d state set to 1", pParentSql->self, pSql->self, idx); - subState->states[idx] = 1; - + if (idx < subState->numOfSub) { + tscDebug("0x%"PRIx64" subquery:0x%"PRIx64", index:%d state set to 1", pParentSql->self, pSql->self, idx); + subState->states[idx] = 1; + } bool done = allSubqueryDone(pParentSql); if (!done) { tscDebug("0x%"PRIx64" sub:%p,%d completed, total:%d", pParentSql->self, pSql, idx, pParentSql->subState.numOfSub);