diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c index a9ec33c078c2192054efc885250a3e994b947784..7534a324099fff01cf4ca47a1da51800ec3c3fb7 100644 --- a/src/client/src/tscSql.c +++ b/src/client/src/tscSql.c @@ -591,7 +591,10 @@ void taos_free_result_imp(TAOS_RES *res, int keepCmd) { tscProcessSql(pSql); // waits for response and then goes on - sem_wait(&pSql->rspSem); + STscObj* pTscObj = pSql->pTscObj; + if (pTscObj->pSql == pSql) { + sem_wait(&pSql->rspSem); + } } else { // if no free resource msg is sent to vnode, we free this object immediately. STscObj* pTscObj = pSql->pTscObj;