From d8e2e0500199e5f375826923eb5bada127590444 Mon Sep 17 00:00:00 2001 From: xywang Date: Thu, 2 Dec 2021 16:41:39 +0800 Subject: [PATCH] [TS-783]: creating table from child table is neither invalid --- src/client/src/tscSQLParser.c | 2 +- tests/pytest/table/create_db_from_normal_db.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 3f6fb635b4..a768cbd48b 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 9ceb2318c5..8b5182c3b1 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() -- GitLab