From 5b0d025b4291ef28e14ed382c20d2a81db61a73b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 8 Oct 2022 15:42:43 +0800 Subject: [PATCH] fix:add totalRows to get the result lines after parser --- src/client/src/tscParseLineProtocol.c | 3 ++- src/client/src/tscParseOpenTSDB.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index f8153abd67..f3bb479144 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -1980,6 +1980,7 @@ static int32_t parseSmlTimeStamp(TAOS_SML_KV **pTS, const char **idx, int32_t le if (len > 0) { value = calloc(len + 1, 1); memcpy(value, start, len); + len = strtrim(value); } ret = convertSmlTimeStamp(*pTS, value, len, info); @@ -2677,7 +2678,7 @@ int32_t tscParseLines(char* data, int32_t len, char* lines[], int numLines, SArr int32_t lenTmp = 0; for(int i = 0; i < len; i++){ if(data[i] == '\n' || i == len - 1){ - if(data[i] != '\n' || i == len - 1){ + if(data[i] != '\n' && i == len - 1){ lenTmp ++; } if(lenTmp > 0) { diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index cdc9d1585a..f0c7b6e0c5 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -428,7 +428,7 @@ static int32_t tscParseTelnetLines(char* data, int32_t len, char* lines[], int n int32_t lenTmp = 0; for(int i = 0; i < len; i++){ if(data[i] == '\n' || i == len - 1){ - if(data[i] != '\n' || i == len - 1){ + if(data[i] != '\n' && i == len - 1){ lenTmp++; } if(lenTmp > 0) { -- GitLab