Merge pull request #1876 from taosdata/hotfix/fix-integer-division-yields-float

integer division yields float in python3.
This commit is contained in:
Shengliang Guan 2020-05-11 20:00:08 +08:00 committed by GitHub
commit 6dc19bc948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 9 deletions

View File

@ -46,16 +46,16 @@ class TDTestCase:
self.maxrows)
tdLog.info("================= step2")
tdLog.info("import %d sequential data" % (self.maxrows / 2))
tdLog.info("import %d sequential data" % (self.maxrows // 2))
startTime = self.startTime
sqlcmd = ['import into tb1 values']
for rid in range(1, self.maxrows / 2 + 1):
for rid in range(1, self.maxrows // 2 + 1):
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
tdSql.execute(" ".join(sqlcmd))
tdLog.info("================= step3")
tdSql.query('select * from tb1')
tdSql.checkRows(self.maxrows / 2)
tdSql.checkRows(self.maxrows // 2)
tdLog.info("================= step4")
tdDnodes.stop(1)
@ -70,7 +70,7 @@ class TDTestCase:
tdLog.info("================= step7")
tdSql.execute('reset query cache')
tdSql.query('select * from tb1 order by ts desc')
tdSql.checkRows(self.maxrows / 2 + 1)
tdSql.checkRows(self.maxrows // 2 + 1)
tdLog.info("================= step8")
tdLog.info("import 10 data in batch before")
@ -83,7 +83,7 @@ class TDTestCase:
tdLog.info("================= step9")
tdSql.execute('reset query cache')
tdSql.query('select * from tb1 order by ts desc')
tdSql.checkRows(self.maxrows / 2 + 11)
tdSql.checkRows(self.maxrows // 2 + 11)
def stop(self):
tdSql.close()

View File

@ -46,16 +46,17 @@ class TDTestCase:
self.maxrows)
tdLog.info("================= step2")
tdLog.info("import %d sequential data" % (self.maxrows / 2))
tdLog.info("import %d sequential data" % (self.maxrows // 2))
startTime = self.startTime
sqlcmd = ['import into tb1 values']
for rid in range(1, self.maxrows / 2 + 1):
for rid in range(1, self.maxrows // 2 + 1):
sqlcmd.append('(%ld, %d)' % (startTime + rid, rid))
tdSql.execute(" ".join(sqlcmd))
tdLog.info("================= step3")
tdSql.query('select * from tb1')
tdSql.checkRows(self.maxrows / 2)
tdSql.checkRows(self.maxrows // 2)
tdLog.info("================= step4")
tdDnodes.stop(1)
@ -73,7 +74,7 @@ class TDTestCase:
tdLog.info("================= step9")
tdSql.execute('reset query cache')
tdSql.query('select * from tb1 order by ts desc')
tdSql.checkRows(self.maxrows / 2)
tdSql.checkRows(self.maxrows // 2)
def stop(self):
tdSql.close()