diff --git a/src/query/src/qSqlParser.c b/src/query/src/qSqlParser.c index de80a29a8cd0a0e86e5baef1ce8f311f6355c200..e465284244fb9a61df3762fd1d2c673ebd87c337 100644 --- a/src/query/src/qSqlParser.c +++ b/src/query/src/qSqlParser.c @@ -744,6 +744,10 @@ void tSetColumnType(TAOS_FIELD *pField, SStrToken *type) { pField->bytes = (int16_t)bytes; } + } else { + if (type->type > 0) { + pField->type = -1; + } } } diff --git a/tests/pytest/table/create.py b/tests/pytest/table/create.py index 54e821246c79b429542316c2f2d3c232a798c03b..51277f28e05a6b9c2a9ce0b7375e6f3b9dd98b76 100644 --- a/tests/pytest/table/create.py +++ b/tests/pytest/table/create.py @@ -28,6 +28,8 @@ class TDTestCase: print("==============step1") print("prepare data") + tdSql.error("create table db.st1 (ts timestamp(8), i int) tags(j int)") + tdSql.error("create table db.st2 (ts timestamp, i int(2)) tags(j int)") tdSql.execute("create table db.st (ts timestamp, i int) tags(j int)") tdSql.execute("create table db.tb using st tags(1)") tdSql.execute("insert into db.tb values(now, 1)")