diff --git a/examples/c/api_with_reqid_test.c b/examples/c/api_with_reqid_test.c index 645ab22469..003639ba00 100644 --- a/examples/c/api_with_reqid_test.c +++ b/examples/c/api_with_reqid_test.c @@ -282,7 +282,7 @@ void veriry_stmt(TAOS* taos) { int32_t* bin_len = malloc(sizeof(int32_t) * 10); int32_t* blob_len = malloc(sizeof(int32_t) * 10); - TAOS_STMT* stmt = taos_stmt_init(taos); + TAOS_STMT* stmt = taos_stmt_init_with_reqid(taos, genReqid()); TAOS_MULTI_BIND params[10]; char is_null[10] = {0}; diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index 3aaec5df05..bb25a595af 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -286,7 +286,7 @@ void *createRequest(uint64_t connId, int32_t type, int64_t reqid) { } pRequest->resType = RES_TYPE__QUERY; - pRequest->requestId = reqid <= 0 ? generateRequestId() : reqid; + pRequest->requestId = reqid == 0 ? generateRequestId() : reqid; pRequest->metric.start = taosGetTimestampUs(); pRequest->body.resInfo.convertUcs4 = true; // convert ucs4 by default diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index 2fbdc60a4e..c5f49bce89 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -14,7 +14,7 @@ static int32_t stmtCreateRequest(STscStmt* pStmt) { if (pStmt->exec.pRequest == NULL) { code = buildRequest(pStmt->taos->id, pStmt->sql.sqlStr, pStmt->sql.sqlLen, NULL, false, &pStmt->exec.pRequest, pStmt->reqid); - if (pStmt->reqid > 0) { + if (pStmt->reqid != 0) { pStmt->reqid++; } if (TSDB_CODE_SUCCESS == code) {