diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 162161b67a185bea356d00b426664efe4ced5ec3..74bc68f89e6014256932f70b1d75052c15874481 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -1134,6 +1134,9 @@ static int32_t parseTableOptions(SInsertParseContext* pCxt) { return buildSyntaxErrMsg(&pCxt->msg, "Invalid option ttl", sToken.z); } pCxt->createTblReq.ttl = taosStr2Int32(sToken.z, NULL, 10); + if (pCxt->createTblReq.ttl < 0) { + return buildSyntaxErrMsg(&pCxt->msg, "Invalid option ttl", sToken.z); + } } else if (TK_COMMENT == sToken.type) { pCxt->pSql += index; NEXT_TOKEN(pCxt->pSql, sToken);