diff --git a/src/client/src/tscParseLineProtocol.c b/src/client/src/tscParseLineProtocol.c index 6d2bd7a0b5697007636e0f141a3718b64e09d27e..a515b6ca3cba1734d158f1ac15e2936a8cd47151 100644 --- a/src/client/src/tscParseLineProtocol.c +++ b/src/client/src/tscParseLineProtocol.c @@ -1879,7 +1879,12 @@ static bool parseSmlValue(TAOS_SML_KV *pKV, const char **index, if ((*cur == ',' || *cur == ' ' || *cur == '\0') && *(cur - 1) != '\\') { //unescaped ' ' or '\0' indicates end of value *is_last_kv = (*cur == ' ' || *cur == '\0') ? true : false; - break; + if (*cur == ' ' && *(cur + 1) == ' ') { + cur++; + continue; + } else { + break; + } } //Escape special character if (*cur == '\\') { @@ -1937,7 +1942,13 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index break; } if (*cur == ' ' && *(cur - 1) != '\\') { - break; + if (*(cur + 1) != ' ') { + break; + } + else { + cur++; + continue; + } } //Comma, Space, Backslash needs to be escaped if any if (*cur == '\\') { diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index e288243ffb22f7927a177a9c9fc1a267b67e5ff0..9904d8557f49f0fde6c9a0252f5ed286a880a452 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -55,7 +55,12 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index, } if (*cur == ' ') { - break; + if (*(cur + 1) != ' ') { + break; + } else { + cur++; + continue; + } } //convert dot to underscore for now, will be removed once dot is allowed in tbname. @@ -96,7 +101,12 @@ static int32_t parseTelnetTimeStamp(TAOS_SML_KV **pTS, int *num_kvs, const char while(*cur != '\0') { if (*cur == ' ') { - break; + if (*(cur + 1) != ' ') { + break; + } else { + cur++; + continue; + } } cur++; len++; @@ -140,7 +150,14 @@ static int32_t parseTelnetMetricValue(TAOS_SML_KV **pKVs, int *num_kvs, const ch while(*cur != '\0') { if (*cur == ' ') { - break; + if (*cur == ' ') { + if (*(cur + 1) != ' ') { + break; + } else { + cur++; + continue; + } + } } cur++; len++; @@ -224,7 +241,12 @@ static int32_t parseTelnetTagValue(TAOS_SML_KV *pKV, const char **index, if (*cur == ' ' || *cur == '\0') { // '\0' indicates end of value *is_last_kv = (*cur == '\0') ? true : false; - break; + if (*cur == ' ' && *(cur + 1) == ' ') { + cur++; + continue; + } else { + break; + } } cur++; len++;