fix: delete max ok

This commit is contained in:
Alex Duan 2024-01-20 14:43:00 +08:00
parent 684bc22130
commit 6cd689ea53
2 changed files with 16 additions and 4 deletions

View File

@ -177,10 +177,10 @@ class TDTestCase(TBase):
sql = f"select ts from d0 where ui={expectMax}"
tdSql.query(sql)
tss = tdSql.getColData(0)
strts = ",".join(map(str,tss))
# delete
sql = f"delete from d0 where ts in ({strts})"
tdSql.execute(sql)
for ts in tss:
# delete
sql = f"delete from d0 where ts = '{ts}'"
tdSql.execute(sql)
expectMax -= 1
self.checkInsertCorrect()

View File

@ -292,3 +292,15 @@ class TBase:
if len(lists) == 0:
tdLog.exit(f"list is empty {tips}")
#
# str util
#
# covert list to sql format string
def listSql(self, lists, sepa = ","):
strs = ""
for ls in lists:
if strs != "":
strs += sepa
strs += f"'{ls}'"
return strs