test:add testcase of data that set stt block is ahead of data block

This commit is contained in:
chenhaoran 2024-02-05 15:26:18 +08:00
parent ecdcc6dee1
commit 3e41bcd4fd
1 changed files with 23 additions and 3 deletions

View File

@ -42,18 +42,38 @@ class TDTestCase:
def run(self):
binPath = self.getPath()
tdLog.debug("insert full data block and flush db")
tdLog.debug("insert full data block that has first time '2021-10-02 00:00:00.001' and flush db")
os.system(f"{binPath} -f ./2-query/megeFileSttQuery.json")
tdSql.execute("flush database db;")
tdLog.debug("insert disorder data and flush db")
tdLog.debug("insert only a piece of data that is behind the time that already exists and flush db")
tdSql.execute("insert into db.d0 values ('2021-10-01 23:59:59.990',12.793,208,0.84) ;")
tdSql.execute("flush database db;")
tdLog.debug("check data")
sleep(1)
tdSql.query("select count(*) from db.d0;")
tdSql.checkData(0,0,10001)
tdSql.execute("drop database db;")
tdLog.debug("insert full data block that has first time '2021-10-02 00:00:00.001' and flush db")
os.system(f"{binPath} -f ./2-query/megeFileSttQuery.json")
tdSql.execute("flush database db;")
tdLog.debug("insert four pieces of disorder data, and the time range covers the data file that was previously placed on disk and flush db")
os.system(f"{binPath} -f ./2-query/megeFileSttQueryUpdate.json")
tdSql.execute("flush database db;")
tdLog.debug("check data")
tdSql.query("select count(*) from db.d0;",queryTimes=3)
tdSql.checkData(0,0,10004)
tdSql.query("select ts from db.d0 limit 5;")
tdSql.checkData(0, 0, '2021-10-02 00:00:00.001')
tdSql.checkData(1, 0, '2021-10-02 00:01:00.000')
tdLog.debug("update disorder data and flush db")
tdLog.debug("update the same disorder data and flush db")
os.system(f"{binPath} -f ./2-query/megeFileSttQueryUpdate.json")
tdSql.query("select ts from db.d0 limit 5;")
tdSql.checkData(0, 0, '2021-10-02 00:00:00.001')