From afd1b650fa57f386e2b2cd96da2e8f65724dcee5 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Fri, 7 May 2021 12:02:17 +0800 Subject: [PATCH] Hotfix/sangshuduo/td 4053 taosdemo more value scope check (#6022) * [TD-4035]: taosdemo more checking for prevent value out of scope. * [TD-4035]: taosdemo more checking for prevent value out of scope. change min rows and max rows to unsigned int and 0 means default. * [TD-4035]: taosdemo more checking for prevent value out of scope. change offset=0 to get all childtable count Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 6facdf7eee..20d7f67138 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -3403,7 +3403,7 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { cJSON* numRecPerReq = cJSON_GetObjectItem(root, "num_of_records_per_req"); if (numRecPerReq && numRecPerReq->type == cJSON_Number) { - if (numRecPerReq->valueint < 0) { + if (numRecPerReq->valueint <= 0) { errorPrint("%s() LN%d, failed to read json, num_of_records_per_req input mistake\n", __func__, __LINE__); goto PARSE_OVER; @@ -4744,7 +4744,7 @@ static int64_t generateDataTail( verbosePrint("%s() LN%d batch=%"PRIu64"\n", __func__, __LINE__, batch); - int64_t k = 0; + uint64_t k = 0; for (k = 0; k < batch;) { char data[MAX_DATA_SIZE]; memset(data, 0, MAX_DATA_SIZE); -- GitLab