提交 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,
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 == '\\') {
......
......@@ -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++;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册