diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 3f6fb635b4ae1cc879ddd890d43f802b14739c68..a768cbd48bc1b97920fae16747a218268607e1af 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -7576,7 +7576,7 @@ int32_t doCheckForCreateFromStable(SSqlObj* pSql, SSqlInfo* pInfo) { return code; } - if (UTIL_TABLE_IS_NORMAL_TABLE(pStableMetaInfo)) { + if (!UTIL_TABLE_IS_SUPER_TABLE(pStableMetaInfo)) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg6); } diff --git a/tests/pytest/table/create_db_from_normal_db.py b/tests/pytest/table/create_db_from_normal_db.py index 9ceb2318c5ae04d881a50017f1b34b096ae9c9de..8b5182c3b16ca31b2bbf966df294e2c4e4c12ff3 100644 --- a/tests/pytest/table/create_db_from_normal_db.py +++ b/tests/pytest/table/create_db_from_normal_db.py @@ -34,6 +34,7 @@ class TDTestCase: tdSql.execute("drop table if exists db.state2;") tdSql.execute("create table db.state2 (ts timestamp, c1 int) tags (t binary(20));") tdSql.query("create table db.test2 using db.state2 tags('tt');") + tdSql.error("create table db.test22 using db.test2 tags('tt');") def stop(self): tdSql.close()