提交 8a8655b6 编写于 作者: H Haojun Liao

[TD-288]

上级 bb088704
...@@ -590,31 +590,28 @@ SSQLToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr, uint32_t numOfIgn ...@@ -590,31 +590,28 @@ SSQLToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr, uint32_t numOfIgn
while (1) { while (1) {
*i += t0.n; *i += t0.n;
bool hasComma = false; int32_t numOfComma = 0;
while ((str[*i] == ' ' || str[*i] == '\n' || str[*i] == '\r' || str[*i] == '\t' || str[*i] == '\f') char t = str[*i];
|| str[*i] == ',') { while (t == ' ' || t == '\n' || t == '\r' || t == '\t' || t == '\f' || t == ',') {
if (str[*i] == ',') { if (t == ',' && (++numOfComma > 1)) { // comma only allowed once
if (false == hasComma) {
hasComma = true;
} else { // comma only allowed once
t0.n = 0; t0.n = 0;
return t0; return t0;
} }
}
(*i)++; (*i)++;
} }
t0.n = tSQLGetToken(&str[*i], &t0.type); t0.n = tSQLGetToken(&str[*i], &t0.type);
bool ignoreFlag = false; bool ignore = false;
for (uint32_t k = 0; k < numOfIgnoreToken; k++) { for (uint32_t k = 0; k < numOfIgnoreToken; k++) {
if (t0.type == ignoreTokenTypes[k]) { if (t0.type == ignoreTokenTypes[k]) {
ignoreFlag = true; ignore = true;
break; break;
} }
} }
if (!ignoreFlag) { if (!ignore) {
break; break;
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册