From fea7265c0a6c40939c7955d003a30da9f80f6736 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 29 Aug 2024 17:40:02 +0800 Subject: [PATCH] multiple binding for example --- tests/script/api/stmt2-example.c | 2 +- tests/script/api/stmt2-nohole.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/script/api/stmt2-example.c b/tests/script/api/stmt2-example.c index c8d48927f8..803e54c156 100644 --- a/tests/script/api/stmt2-example.c +++ b/tests/script/api/stmt2-example.c @@ -29,7 +29,7 @@ void do_stmt(TAOS* taos) { char is_null2[2] = {0, 2}; // TAOS_STMT2_OPTION option = {0}; // TAOS_STMT2_OPTION option = {0, true, true, stmtAsyncQueryCb, NULL}; - TAOS_STMT2_OPTION option = {0, true, true, NULL, NULL}; + TAOS_STMT2_OPTION option = {0, true, false, NULL, NULL}; char* tbs[2] = {"tb", "tb2"}; int t1_val[2] = {0, 1}; diff --git a/tests/script/api/stmt2-nohole.c b/tests/script/api/stmt2-nohole.c index 2e78f7bc60..b29dd3e826 100644 --- a/tests/script/api/stmt2-nohole.c +++ b/tests/script/api/stmt2-nohole.c @@ -116,7 +116,7 @@ void veriry_stmt(TAOS* taos) { #include "time.h" clock_t start, end; - TAOS_STMT2_OPTION option = {0, true, true, stmtAsyncQueryCb, NULL}; + TAOS_STMT2_OPTION option = {0, true, false, stmtAsyncQueryCb, NULL}; start = clock(); TAOS_STMT2* stmt = taos_stmt2_init(taos, &option); @@ -270,10 +270,11 @@ void veriry_stmt(TAOS* taos) { blob_buffer += blob_len[i]; blob2_buffer += blob_len2[i]; } - + int run_time = 0; char* tbname = "m2"; TAOS_STMT2_BIND* bind_cols[1] = {¶ms[0]}; TAOS_STMT2_BINDV bindv = {1, &tbname, NULL, &bind_cols[0]}; +_bind_again: start = clock(); // taos_stmt2_bind_param(stmt, "m1", NULL, params, -1); taos_stmt2_bind_param(stmt, &bindv, -1); @@ -331,7 +332,9 @@ void veriry_stmt(TAOS* taos) { sem_wait(&sem); (void)sem_destroy(&sem); - + if (++run_time < 2) { + goto _bind_again; + } taos_stmt2_close(stmt); free(t8_len);