提交 3e4b32bb 编写于 作者: G Ganlin Zhao

[TD-10532]<enhance>: schemaless line permits multiple whitespace delimiters

上级 a2ea28e6
...@@ -1879,7 +1879,12 @@ static bool parseSmlValue(TAOS_SML_KV *pKV, const char **index, ...@@ -1879,7 +1879,12 @@ static bool parseSmlValue(TAOS_SML_KV *pKV, const char **index,
if ((*cur == ',' || *cur == ' ' || *cur == '\0') && *(cur - 1) != '\\') { if ((*cur == ',' || *cur == ' ' || *cur == '\0') && *(cur - 1) != '\\') {
//unescaped ' ' or '\0' indicates end of value //unescaped ' ' or '\0' indicates end of value
*is_last_kv = (*cur == ' ' || *cur == '\0') ? true : false; *is_last_kv = (*cur == ' ' || *cur == '\0') ? true : false;
break; if (*cur == ' ' && *(cur + 1) == ' ') {
cur++;
continue;
} else {
break;
}
} }
//Escape special character //Escape special character
if (*cur == '\\') { if (*cur == '\\') {
...@@ -1937,7 +1942,13 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index ...@@ -1937,7 +1942,13 @@ static int32_t parseSmlMeasurement(TAOS_SML_DATA_POINT *pSml, const char **index
break; break;
} }
if (*cur == ' ' && *(cur - 1) != '\\') { if (*cur == ' ' && *(cur - 1) != '\\') {
break; if (*(cur + 1) != ' ') {
break;
}
else {
cur++;
continue;
}
} }
//Comma, Space, Backslash needs to be escaped if any //Comma, Space, Backslash needs to be escaped if any
if (*cur == '\\') { if (*cur == '\\') {
......
...@@ -55,7 +55,12 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index, ...@@ -55,7 +55,12 @@ static int32_t parseTelnetMetric(TAOS_SML_DATA_POINT *pSml, const char **index,
} }
if (*cur == ' ') { 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. //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 ...@@ -96,7 +101,12 @@ static int32_t parseTelnetTimeStamp(TAOS_SML_KV **pTS, int *num_kvs, const char
while(*cur != '\0') { while(*cur != '\0') {
if (*cur == ' ') { if (*cur == ' ') {
break; if (*(cur + 1) != ' ') {
break;
} else {
cur++;
continue;
}
} }
cur++; cur++;
len++; len++;
...@@ -140,7 +150,14 @@ static int32_t parseTelnetMetricValue(TAOS_SML_KV **pKVs, int *num_kvs, const ch ...@@ -140,7 +150,14 @@ static int32_t parseTelnetMetricValue(TAOS_SML_KV **pKVs, int *num_kvs, const ch
while(*cur != '\0') { while(*cur != '\0') {
if (*cur == ' ') { if (*cur == ' ') {
break; if (*cur == ' ') {
if (*(cur + 1) != ' ') {
break;
} else {
cur++;
continue;
}
}
} }
cur++; cur++;
len++; len++;
...@@ -224,7 +241,12 @@ static int32_t parseTelnetTagValue(TAOS_SML_KV *pKV, const char **index, ...@@ -224,7 +241,12 @@ static int32_t parseTelnetTagValue(TAOS_SML_KV *pKV, const char **index,
if (*cur == ' ' || *cur == '\0') { if (*cur == ' ' || *cur == '\0') {
// '\0' indicates end of value // '\0' indicates end of value
*is_last_kv = (*cur == '\0') ? true : false; *is_last_kv = (*cur == '\0') ? true : false;
break; if (*cur == ' ' && *(cur + 1) == ' ') {
cur++;
continue;
} else {
break;
}
} }
cur++; cur++;
len++; len++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册