From af33e1184063a047de7eb26805fd4bd314dce579 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Tue, 11 May 2021 19:06:02 +0800 Subject: [PATCH] [TD-4136]: taosdemo max records per req < 32767 (#6082) Co-authored-by: Shuduo Sang --- src/kit/taosdemo/taosdemo.c | 12 +++++++++++- .../tools/taosdemoAllTest/speciQueryRestful.json | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 3c83cb7a5e..a3a8968017 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -68,6 +68,14 @@ enum TEST_MODE { INVAID_TEST }; +enum QUERY_MODE { + SYNC_QUERY_MODE, // 0 + ASYNC_QUERY_MODE, // 1 + INVALID_MODE +}; + +#define MAX_RECORDS_PER_REQ 32766 + #define MAX_SQL_SIZE 65536 #define BUFFER_SIZE (65536*2) #define COND_BUF_LEN BUFFER_SIZE - 30 @@ -3436,10 +3444,12 @@ static bool getMetaFromInsertJsonFile(cJSON* root) { errorPrint("%s() LN%d, failed to read json, num_of_records_per_req input mistake\n", __func__, __LINE__); goto PARSE_OVER; + } else if (numRecPerReq->valueint > MAX_RECORDS_PER_REQ) { + numRecPerReq->valueint = MAX_RECORDS_PER_REQ; } g_args.num_of_RPR = numRecPerReq->valueint; } else if (!numRecPerReq) { - g_args.num_of_RPR = UINT64_MAX; + g_args.num_of_RPR = MAX_RECORDS_PER_REQ; } else { errorPrint("%s() LN%d, failed to read json, num_of_records_per_req not found\n", __func__, __LINE__); diff --git a/tests/pytest/tools/taosdemoAllTest/speciQueryRestful.json b/tests/pytest/tools/taosdemoAllTest/speciQueryRestful.json index 98e9b7a4e8..bc3a66f43c 100644 --- a/tests/pytest/tools/taosdemoAllTest/speciQueryRestful.json +++ b/tests/pytest/tools/taosdemoAllTest/speciQueryRestful.json @@ -8,7 +8,7 @@ "confirm_parameter_prompt": "no", "databases": "db", "query_times": 2, - "query_mode": "restful", + "query_mode": "rest", "specified_table_query": { "query_interval": 1, "concurrent": 3, @@ -35,4 +35,4 @@ ] } } - \ No newline at end of file + -- GitLab