diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index 1739dced8f..ae59319cec 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1701,7 +1701,7 @@ int stmtClose2(TAOS_STMT2* stmt) { pStmt->bindThreadInUse = false; } - if (pStmt->options.asyncExecFn) { + if (pStmt->options.asyncExecFn && !pStmt->semWaited) { (void)tsem_wait(&pStmt->asyncQuerySem); }