test: del db and max topics invalid

This commit is contained in:
plum-lihui 2023-07-18 20:18:43 +08:00
parent 3c12033602
commit 79620c99a5
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))