From ff93a4c3a443396a366607bbb785820b34639120 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 13 Sep 2022 14:36:56 +0800 Subject: [PATCH] feat: support ttl in create table automatic --- source/libs/parser/src/parInsert.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 162161b67a..74bc68f89e 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); -- GitLab