From 5e0a3f8676daca186086212d428626f510d26a95 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 18 Jan 2024 11:38:43 +0800 Subject: [PATCH 1/2] fix: remove num_of_records_per_req limitation buffer len error --- src/benchCommandOpt.c | 6 +++--- src/benchData.c | 4 ++-- src/benchInsert.c | 1 - src/benchJsonOpt.c | 8 ++++---- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/benchCommandOpt.c b/src/benchCommandOpt.c index 02fcebaf..4170677a 100644 --- a/src/benchCommandOpt.c +++ b/src/benchCommandOpt.c @@ -309,9 +309,9 @@ void modifyArgument() { } if (superTable->iface == STMT_IFACE) { - if (g_arguments->reqPerReq > INT16_MAX) { - g_arguments->reqPerReq = INT16_MAX; - } + //if (g_arguments->reqPerReq > INT16_MAX) { + // g_arguments->reqPerReq = INT16_MAX; + //} if (g_arguments->prepared_rand > g_arguments->reqPerReq) { g_arguments->prepared_rand = g_arguments->reqPerReq; } diff --git a/src/benchData.c b/src/benchData.c index 664ea985..982f089b 100644 --- a/src/benchData.c +++ b/src/benchData.c @@ -822,7 +822,7 @@ static int generateRandDataSQL(SSuperTable *stbInfo, char *sampleDataBuf, static int fillStmt( SSuperTable *stbInfo, char *sampleDataBuf, - int bufLen, + int64_t bufLen, int lenOfOneRow, BArray *fields, int64_t loop, bool tag, BArray *childCols) { // fillStmt() @@ -835,7 +835,7 @@ static int fillStmt( if (childCols) { childCol = benchArrayGet(childCols, i); } - int n = 0; + int64_t n = 0; switch (field->type) { case TSDB_DATA_TYPE_BOOL: { bool boolTmp = tmpBool(field); diff --git a/src/benchInsert.c b/src/benchInsert.c index e7670ce6..5a0be02a 100644 --- a/src/benchInsert.c +++ b/src/benchInsert.c @@ -1696,7 +1696,6 @@ static void *syncWriteInterlace(void *sarg) { stbInfo->insert_interval); toolsMsleep((int32_t)stbInfo->insert_interval); } - break; } } diff --git a/src/benchJsonOpt.c b/src/benchJsonOpt.c index 203ddcb1..f4bed63a 100644 --- a/src/benchJsonOpt.c +++ b/src/benchJsonOpt.c @@ -763,9 +763,9 @@ static int getStableInfo(tools_cJSON *dbinfos, int index) { superTable->iface = REST_IFACE; } else if (0 == strcasecmp(stbIface->valuestring, "stmt")) { superTable->iface = STMT_IFACE; - if (g_arguments->reqPerReq > INT16_MAX) { - g_arguments->reqPerReq = INT16_MAX; - } + //if (g_arguments->reqPerReq > INT16_MAX) { + // g_arguments->reqPerReq = INT16_MAX; + //} if (g_arguments->reqPerReq > g_arguments->prepared_rand) { g_arguments->prepared_rand = g_arguments->reqPerReq; } @@ -1400,7 +1400,7 @@ static int getMetaFromInsertJsonFile(tools_cJSON *json) { g_arguments->reqPerReq = DEFAULT_REQ_PER_REQ; } - if (g_arguments->reqPerReq > 32768) { + if (g_arguments->reqPerReq > INT32_MAX) { infoPrint("warning: num_of_records_per_req item in json config need less than 32768. current = %d. now reset to default.\n", g_arguments->reqPerReq); g_arguments->reqPerReq = DEFAULT_REQ_PER_REQ; } From 429662dac1c7eb36a757ae4e17c5a87a7496acae Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Thu, 18 Jan 2024 11:41:32 +0800 Subject: [PATCH 2/2] fix: remove break --- src/benchInsert.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/benchInsert.c b/src/benchInsert.c index 5a0be02a..e7670ce6 100644 --- a/src/benchInsert.c +++ b/src/benchInsert.c @@ -1696,6 +1696,7 @@ static void *syncWriteInterlace(void *sarg) { stbInfo->insert_interval); toolsMsleep((int32_t)stbInfo->insert_interval); } + break; } }