diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index a079198be3f2c192ab175417dd3946fc4e976c54..a6c1acfc35903750e412775b53be924fc5550b87 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -138,21 +138,41 @@ static int32_t parseTelnetMetricValue(TAOS_SML_KV **pKVs, int *num_kvs, const ch const char *start, *cur; int32_t ret = TSDB_CODE_SUCCESS; int len = 0; + bool searchQuote = false; char key[] = OTD_METRIC_VALUE_COLUMN_NAME; char *value = NULL; start = cur = *index; + //if metric value is string + if (*cur == '"') { + searchQuote = true; + cur += 1; + len += 1; + } else if (*cur == 'L' && *(cur + 1) == '"') { + searchQuote = true; + cur += 2; + len += 2; + } + while(*cur != '\0') { if (*cur == ' ') { - if (*cur == ' ') { - if (*(cur + 1) != ' ') { - break; + if (searchQuote == true) { + if (*(cur - 1) == '"' && len != 1 && len != 2) { + searchQuote = false; } else { cur++; + len++; continue; } } + + if (*(cur + 1) != ' ') { + break; + } else { + cur++; + continue; + } } cur++; len++;