From ca5972018e750ca69ad3edb1e0d34e1fe8b80a3a Mon Sep 17 00:00:00 2001 From: Alex Duan <51781608+DuanKuanJun@users.noreply.github.com> Date: Thu, 29 Jun 2023 17:09:02 +0800 Subject: [PATCH] fix: 2.6 version response format (#683) * fix: 2.6 version response format * fix: support -y option compatibioty 2.6 * fix: taodump remove -y option --- src/benchUtil.c | 8 ++++++++ src/taosdump.c | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/benchUtil.c b/src/benchUtil.c index 69d6cf37..07b1358f 100644 --- a/src/benchUtil.c +++ b/src/benchUtil.c @@ -665,6 +665,14 @@ int postProceSql(char *sqlstr, char* dbName, int precision, int iface, rest_port, tcp, sockfd, filePath, responseBuf, response_length); + // compatibility 2.6 + if (-1 == g_arguments->rest_server_ver_major) { + // confirm version is 2.x according to "succ" + if (NULL != strstr(responseBuf, succMessage) && iface == REST_IFACE) { + g_arguments->rest_server_ver_major = 2; + } + } + if (NULL != strstr(responseBuf, resHttpOk) && iface == REST_IFACE) { // if taosd is not starting , rest_server_ver_major can't be got by 'select server_version()' , so is -1 if (-1 == g_arguments->rest_server_ver_major || 3 <= g_arguments->rest_server_ver_major) { diff --git a/src/taosdump.c b/src/taosdump.c index e42af372..569bd660 100644 --- a/src/taosdump.c +++ b/src/taosdump.c @@ -451,8 +451,6 @@ static struct argp_option options[] = { {"schemaonly", 's', 0, 0, "Only dump table schemas.", 2}, {"without-property", 'N', 0, 0, "Dump database without its properties.", 2}, - {"answer-yes", 'y', 0, 0, - "Input yes for prompt. It will skip data file checking!", 3}, {"avro-codec", 'd', "snappy", 0, "Choose an avro codec among null, deflate, snappy, and lzma.", 4}, {"start-time", 'S', "START_TIME", 0, @@ -904,17 +902,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { break; case 'E': - break; - case 's': - break; - case 'L': - break; - case 'I': - break; - case 'n': break;