diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index a286531588..a5cf755a74 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -110,7 +110,7 @@ typedef struct SMemParam { static int32_t skipInsertInto(char** pSql, SMsgBuf* pMsg) { SToken sToken; NEXT_TOKEN(*pSql, sToken); - if (TK_INSERT != sToken.type) { + if (TK_INSERT != sToken.type && TK_IMPORT != sToken.type) { return buildSyntaxErrMsg(pMsg, "keyword INSERT is expected", sToken.z); } NEXT_TOKEN(*pSql, sToken); diff --git a/source/libs/parser/src/parser.c b/source/libs/parser/src/parser.c index 777927576a..4f8ea00271 100644 --- a/source/libs/parser/src/parser.c +++ b/source/libs/parser/src/parser.c @@ -34,6 +34,7 @@ bool qIsInsertValuesSql(const char* pStr, size_t length) { do { pStr += index; + index = 0; t = tStrGetToken((char*)pStr, &index, false); if (TK_USING == t.type || TK_VALUES == t.type) { return true;