Merge pull request #22115 from taosdata/test_main/lihui

test: del db and max topics invalid
This commit is contained in:
Hui Li 2023-07-19 08:43:21 +08:00 committed by GitHub
commit fbecd296f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -216,6 +216,32 @@ class TDTestCase:
tdLog.info("create topic sql: %s"%sqlString)
tdSql.error(sqlString)
tdLog.info("drop database when there are topic")
sqlString = "drop database %s" %(paraDict['dbName'])
tdLog.info("drop database sql: %s"%sqlString)
tdSql.error(sqlString)
tdLog.info("drop all topic for re-create")
tdSql.query('show topics;')
topicNum = tdSql.queryRows
tdLog.info(" topic count: %d"%(topicNum))
for i in range(topicNum):
sqlString = "drop topic %s" %(tdSql.getData(i, 0))
tdLog.info("drop topic sql: %s"%sqlString)
tdSql.execute(sqlString)
time.sleep(1)
tdLog.info("re-create topics")
topicNamePrefix = 'newTopic_'
queryString = "select * from %s.%s"%(paraDict['dbName'], paraDict['stbName'])
for i in range(topicNum):
sqlString = "create topic %s%d as %s" %(topicNamePrefix, i, queryString)
tdLog.info("create topic sql: %s"%sqlString)
tdSql.execute(sqlString)
#=================================================#
tdLog.info("drop all topic for testcase2")
tdSql.query('show topics;')
topicNum = tdSql.queryRows
tdLog.info(" topic count: %d"%(topicNum))