fix: delete max ok
This commit is contained in:
parent
684bc22130
commit
6cd689ea53
|
@ -177,10 +177,10 @@ class TDTestCase(TBase):
|
||||||
sql = f"select ts from d0 where ui={expectMax}"
|
sql = f"select ts from d0 where ui={expectMax}"
|
||||||
tdSql.query(sql)
|
tdSql.query(sql)
|
||||||
tss = tdSql.getColData(0)
|
tss = tdSql.getColData(0)
|
||||||
strts = ",".join(map(str,tss))
|
for ts in tss:
|
||||||
# delete
|
# delete
|
||||||
sql = f"delete from d0 where ts in ({strts})"
|
sql = f"delete from d0 where ts = '{ts}'"
|
||||||
tdSql.execute(sql)
|
tdSql.execute(sql)
|
||||||
expectMax -= 1
|
expectMax -= 1
|
||||||
|
|
||||||
self.checkInsertCorrect()
|
self.checkInsertCorrect()
|
||||||
|
|
|
@ -292,3 +292,15 @@ class TBase:
|
||||||
if len(lists) == 0:
|
if len(lists) == 0:
|
||||||
tdLog.exit(f"list is empty {tips}")
|
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
|
Loading…
Reference in New Issue