From f0772b1465bdea18620b79b2020139a14f56ca6d Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 8 Nov 2021 16:34:56 +0800 Subject: [PATCH] fix/TD-10717 tips if insert operation using multi empty comma --- src/client/src/tscParseInsert.c | 5 +++++ src/util/src/ttokenizer.c | 1 + 2 files changed, 6 insertions(+) diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index d7ceee6302..85bed39a2e 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -1419,6 +1419,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. diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 0c7b65be80..8571b32517 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -626,6 +626,7 @@ 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; } -- GitLab