未验证 提交 63d795cf 编写于 作者: wmmhello's avatar wmmhello 提交者: GitHub

Merge pull request #8630 from taosdata/fix/TD-10717

fix/TD-10717 <fix> tips if insert operation using multi empty comma
......@@ -1417,6 +1417,11 @@ int tsParseInsertSql(SSqlObj *pSql) {
goto _clean;
}
if (sToken.type == TK_ILLEGAL) { // ,,,, like => insert into t values(now,1),,,,(now+1s,2);
code = tscSQLSyntaxErrMsg(pInsertParam->msg, NULL, str);
goto _clean;
}
/*
* if no data has been generated during parsing the sql string, error msg will return
* Otherwise, create the first submit block and submit to virtual node.
......
......@@ -626,12 +626,16 @@ SStrToken tStrGetToken(char* str, int32_t* i, bool isPrevOptr) {
while (isspace(t) || t == ',') {
if (t == ',' && (++numOfComma > 1)) { // comma only allowed once
t0.n = 0;
t0.type = TK_ILLEGAL;
return t0;
}
t = str[++(*i)];
}
if (str[*i] == 0) {
t0.n = 0;
break;
}
t0.n = tGetToken(&str[*i], &t0.type);
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册