From 31b635315997a959084b22578ca71bc67622b3bd Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 4 Sep 2024 16:11:46 +0800 Subject: [PATCH] stmt2/async: wait before pRequest checking --- source/client/src/clientStmt2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index e8cf9a3bde..e7e08c0982 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1263,6 +1263,10 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) { STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_BIND)); + if (pStmt->options.asyncExecFn) { + (void)tsem_wait(&pStmt->asyncQuerySem); + } + if (pStmt->bInfo.needParse && pStmt->sql.runTimes && pStmt->sql.type > 0 && STMT_TYPE_MULTI_INSERT != pStmt->sql.type) { pStmt->bInfo.needParse = false; @@ -1279,10 +1283,6 @@ int stmtBindBatch2(TAOS_STMT2* stmt, TAOS_STMT2_BIND* bind, int32_t colIdx) { STMT_ERR_RET(stmtParseSql(pStmt)); } - if (pStmt->options.asyncExecFn) { - (void)tsem_wait(&pStmt->asyncQuerySem); - } - if (STMT_TYPE_QUERY == pStmt->sql.type) { STMT_ERR_RET(qStmtBindParams2(pStmt->sql.pQuery, bind, colIdx));