From b5983764493679f95286cc10fd860b29e25c6d6b Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 11 Jun 2024 14:07:28 +0800 Subject: [PATCH] fix: invalid exec request issue --- source/client/src/clientStmt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index d18fb23ab2..32d31585ea 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -1140,12 +1140,11 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) { if (pStmt->exec.pRequest && STMT_TYPE_QUERY == pStmt->sql.type && pStmt->sql.runTimes) { taos_free_result(pStmt->exec.pRequest); pStmt->exec.pRequest = NULL; - - STMT_ERR_RET(stmtCreateRequest(pStmt)); } + STMT_ERR_RET(stmtCreateRequest(pStmt)); + if (pStmt->bInfo.needParse) { - STMT_ERR_RET(stmtCreateRequest(pStmt)); STMT_ERR_RET(stmtParseSql(pStmt)); } @@ -1625,8 +1624,9 @@ int stmtGetColFields(TAOS_STMT* stmt, int* nums, TAOS_FIELD_E** fields) { STMT_ERR_RET(stmtCreateRequest(pStmt)); } + STMT_ERRI_JRET(stmtCreateRequest(pStmt)); + if (pStmt->bInfo.needParse) { - STMT_ERRI_JRET(stmtCreateRequest(pStmt)); STMT_ERRI_JRET(stmtParseSql(pStmt)); } @@ -1657,6 +1657,7 @@ int stmtGetParamNum(TAOS_STMT* stmt, int* nums) { } STMT_ERR_RET(stmtCreateRequest(pStmt)); + if (pStmt->bInfo.needParse) { STMT_ERR_RET(stmtParseSql(pStmt)); }