未验证 提交 3bf58e6e 编写于 作者: S Shengliang Guan 提交者: GitHub

Merge pull request #6417 from taosdata/test/TD-4553

[TD-4553]<test>fix timestamp error
...@@ -60,14 +60,14 @@ class TDTestCase: ...@@ -60,14 +60,14 @@ class TDTestCase:
x = 0 x = 0
while (x < rowNum): while (x < rowNum):
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x ) # TSIM: sql insert into $tb values (1605045600000 + $ms , $x )
tdLog.info( tdLog.info(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
i = i + 1 i = i + 1
...@@ -81,13 +81,13 @@ class TDTestCase: ...@@ -81,13 +81,13 @@ class TDTestCase:
(tb, mt)) (tb, mt))
x = 0 x = 0
while (x < rowNum): while (x < rowNum):
ms = "%dm" % x ms = x * 60000
tdLog.info( tdLog.info(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
i = i + 1 i = i + 1
...@@ -104,36 +104,36 @@ class TDTestCase: ...@@ -104,36 +104,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from %s where ts < now + 4m # TSIM: sql select * from %s where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts < now + 4m' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % mt)
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m # TSIM: sql select * from %s where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts > now + 4m' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % mt)
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts = now + 4m # TSIM: sql select * from %s where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % mt) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts = now + 4m' % mt) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % mt)
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
mt) mt)
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
tdSql.checkRows(10) tdSql.checkRows(10)
...@@ -267,91 +267,91 @@ class TDTestCase: ...@@ -267,91 +267,91 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 = true # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true' %
mt) mt)
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> true # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true' %
mt) mt)
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = false # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false' %
mt) mt)
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> false # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false' %
mt) mt)
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = false # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false' %
mt) mt)
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> false # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false' %
mt) mt)
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> false # tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> false # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false
# and ts < now + 5m # and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -361,84 +361,84 @@ class TDTestCase: ...@@ -361,84 +361,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol2 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol2 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -448,84 +448,84 @@ class TDTestCase: ...@@ -448,84 +448,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol3 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol3 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 # tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -535,104 +535,104 @@ class TDTestCase: ...@@ -535,104 +535,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step9 # TSIM: print =============== step9
tdLog.info('=============== step9') tdLog.info('=============== step9')
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol1 = true # tgcol1 = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = true' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol1 <> true # tgcol1 <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> true' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = false # tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> false # tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = false # tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> false # tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol1 <> false # tgcol2 <> 0 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> false # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -642,104 +642,104 @@ class TDTestCase: ...@@ -642,104 +642,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol1 = true # tgcol1 = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = true' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol1 <> true # tgcol1 <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> true' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> true' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol1 = false # tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol1 <> false # tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol1 = false # tgcol1 = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol1 <> false # tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol1 <> false # tgcol3 <> 0 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> false # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -749,104 +749,104 @@ class TDTestCase: ...@@ -749,104 +749,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol2 = 1 # tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol2 <> 1 # tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol2 <> 0 # tgcol3 <> 0 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -856,104 +856,104 @@ class TDTestCase: ...@@ -856,104 +856,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step12 # TSIM: print =============== step12
tdLog.info('=============== step12') tdLog.info('=============== step12')
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1034,12 +1034,12 @@ class TDTestCase: ...@@ -1034,12 +1034,12 @@ class TDTestCase:
# TSIM: print =============== step15 # TSIM: print =============== step15
tdLog.info('=============== step15') tdLog.info('=============== step15')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1050,13 +1050,13 @@ class TDTestCase: ...@@ -1050,13 +1050,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true # tgcol1 = true
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1067,13 +1067,13 @@ class TDTestCase: ...@@ -1067,13 +1067,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true and tgcol2 = 1 # tgcol1 = true and tgcol2 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1084,11 +1084,11 @@ class TDTestCase: ...@@ -1084,11 +1084,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 # tgcol1 = true and tgcol2 = 1 and tgcol3 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1204,13 +1204,13 @@ class TDTestCase: ...@@ -1204,13 +1204,13 @@ class TDTestCase:
# TSIM: print =============== step18 # TSIM: print =============== step18
tdLog.info('=============== step18') tdLog.info('=============== step18')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001
# group by tgcol2 # group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1221,13 +1221,13 @@ class TDTestCase: ...@@ -1221,13 +1221,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true group by tgcol2 # tgcol1 = true group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true group by tgcol2' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1238,11 +1238,11 @@ class TDTestCase: ...@@ -1238,11 +1238,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true and tgcol2 = 1 group by tgcol2 # tgcol1 = true and tgcol2 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 group by tgcol2' % mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1253,10 +1253,10 @@ class TDTestCase: ...@@ -1253,10 +1253,10 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 # tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt)
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
......
...@@ -64,14 +64,14 @@ class TDTestCase: ...@@ -64,14 +64,14 @@ class TDTestCase:
(tb, mt)) (tb, mt))
x = 0 x = 0
while (x < rowNum): while (x < rowNum):
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x ) # TSIM: sql insert into $tb values (1605045600000 + $ms , $x )
tdLog.info( tdLog.info(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
i = i + 1 i = i + 1
...@@ -87,14 +87,13 @@ class TDTestCase: ...@@ -87,14 +87,13 @@ class TDTestCase:
(tb, mt)) (tb, mt))
x = 0 x = 0
while (x < rowNum): while (x < rowNum):
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
"insert into %s values (now + %s, %d)" % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
i = i + 1 i = i + 1
...@@ -111,36 +110,36 @@ class TDTestCase: ...@@ -111,36 +110,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from %s where ts < now + 4m # TSIM: sql select * from %s where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts < now + 4m' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % mt)
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m # TSIM: sql select * from %s where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts > now + 4m' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % mt)
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts = now + 4m # TSIM: sql select * from %s where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % mt) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % mt)
tdSql.query('select * from %s where ts = now + 4m' % mt) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % mt)
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -322,84 +321,84 @@ class TDTestCase: ...@@ -322,84 +321,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol1 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol1 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol1 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol1 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol1 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol1 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol1 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -409,84 +408,84 @@ class TDTestCase: ...@@ -409,84 +408,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol2 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol2 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol2 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -496,84 +495,84 @@ class TDTestCase: ...@@ -496,84 +495,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step9 # TSIM: print =============== step9
tdLog.info('=============== step9') tdLog.info('=============== step9')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol3 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol3 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol3 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 # tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -583,84 +582,84 @@ class TDTestCase: ...@@ -583,84 +582,84 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol4 = 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % mt)
tdSql.query('select * from %s where ts > now + 4m and tgcol4 = 1' % mt) tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1
tdLog.info('select * from %s where ts > now + 4m and tgcol4 <> 1' % mt) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol4 = 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % mt)
tdSql.query('select * from %s where ts < now + 4m and tgcol4 = 0' % mt) tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info('select * from %s where ts < now + 4m and tgcol4 <> 0' % mt) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0
tdLog.info('select * from %s where ts <= now + 4m and tgcol4 = 0' % mt) tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' % mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -670,104 +669,104 @@ class TDTestCase: ...@@ -670,104 +669,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol1 = 1 # tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol1 <> 1 # tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -777,104 +776,104 @@ class TDTestCase: ...@@ -777,104 +776,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step12 # TSIM: print =============== step12
tdLog.info('=============== step12') tdLog.info('=============== step12')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol1 = 1 # tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol1 <> 1 # tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol1 <> 0 # tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol1 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -884,104 +883,104 @@ class TDTestCase: ...@@ -884,104 +883,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol2 = 1 # tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol2 <> 1 # tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol2 <> 0 # tgcol3 <> 0 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -991,104 +990,104 @@ class TDTestCase: ...@@ -991,104 +990,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step14 # TSIM: print =============== step14
tdLog.info('=============== step14') tdLog.info('=============== step14')
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol4 = 1 # tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol4 <> 1 # tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol4 <> 0 # tgcol3 <> 0 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol4 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1098,104 +1097,104 @@ class TDTestCase: ...@@ -1098,104 +1097,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step15 # TSIM: print =============== step15
tdLog.info('=============== step15') tdLog.info('=============== step15')
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1205,104 +1204,104 @@ class TDTestCase: ...@@ -1205,104 +1204,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step16 # TSIM: print =============== step16
tdLog.info('=============== step16') tdLog.info('=============== step16')
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1312,105 +1311,105 @@ class TDTestCase: ...@@ -1312,105 +1311,105 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step17 # TSIM: print =============== step17
tdLog.info('=============== step17') tdLog.info('=============== step17')
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
mt) mt)
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts
# < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
mt) mt)
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1508,12 +1507,12 @@ class TDTestCase: ...@@ -1508,12 +1507,12 @@ class TDTestCase:
# TSIM: print =============== step20 # TSIM: print =============== step20
tdLog.info('=============== step20') tdLog.info('=============== step20')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1524,13 +1523,13 @@ class TDTestCase: ...@@ -1524,13 +1523,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 # tgcol1 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1541,13 +1540,13 @@ class TDTestCase: ...@@ -1541,13 +1540,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 # tgcol1 = 1 and tgcol2 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1558,13 +1557,13 @@ class TDTestCase: ...@@ -1558,13 +1557,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1575,10 +1574,10 @@ class TDTestCase: ...@@ -1575,10 +1574,10 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt)
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -1722,13 +1721,13 @@ class TDTestCase: ...@@ -1722,13 +1721,13 @@ class TDTestCase:
# TSIM: print =============== step23 # TSIM: print =============== step23
tdLog.info('=============== step23') tdLog.info('=============== step23')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001
# group by tgcol2 # group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1739,13 +1738,13 @@ class TDTestCase: ...@@ -1739,13 +1738,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 group by tgcol2 # tgcol1 = 1 group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
mt) mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1756,11 +1755,11 @@ class TDTestCase: ...@@ -1756,11 +1755,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 group by tgcol2 # tgcol1 = 1 and tgcol2 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % mt)
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' %
mt) mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1771,10 +1770,10 @@ class TDTestCase: ...@@ -1771,10 +1770,10 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt)
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -1784,11 +1783,11 @@ class TDTestCase: ...@@ -1784,11 +1783,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and
# tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by
# tgcol2 # tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt)
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt)
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
......
...@@ -76,14 +76,13 @@ class TDTestCase: ...@@ -76,14 +76,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s, %d)' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s, %d)' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -105,14 +104,13 @@ class TDTestCase: ...@@ -105,14 +104,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s, %d)' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s, %d)' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -131,36 +129,36 @@ class TDTestCase: ...@@ -131,36 +129,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -377,98 +375,98 @@ class TDTestCase: ...@@ -377,98 +375,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -478,98 +476,98 @@ class TDTestCase: ...@@ -478,98 +476,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step9 # TSIM: print =============== step9
tdLog.info('=============== step9') tdLog.info('=============== step9')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -579,98 +577,98 @@ class TDTestCase: ...@@ -579,98 +577,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 # tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -680,98 +678,98 @@ class TDTestCase: ...@@ -680,98 +678,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -781,98 +779,98 @@ class TDTestCase: ...@@ -781,98 +779,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step12 # TSIM: print =============== step12
tdLog.info('=============== step12') tdLog.info('=============== step12')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol5 <> 0 # tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -882,104 +880,104 @@ class TDTestCase: ...@@ -882,104 +880,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol1 = 1 # tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol1 <> 1 # tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol1 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -989,104 +987,104 @@ class TDTestCase: ...@@ -989,104 +987,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step14 # TSIM: print =============== step14
tdLog.info('=============== step14') tdLog.info('=============== step14')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol2 = 1 # tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol2 <> 1 # tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol2 <> 0 # tgcol3 <> 0 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1096,104 +1094,104 @@ class TDTestCase: ...@@ -1096,104 +1094,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step15 # TSIM: print =============== step15
tdLog.info('=============== step15') tdLog.info('=============== step15')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol4 = 1 # tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol4 <> 1 # tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol4 <> 0 # tgcol3 <> 0 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol4 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1203,104 +1201,104 @@ class TDTestCase: ...@@ -1203,104 +1201,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step16 # TSIM: print =============== step16
tdLog.info('=============== step16') tdLog.info('=============== step16')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and
# tgcol4 = 1 # tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and
# tgcol4 <> 1 # tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol5 <> 0 and tgcol4 <> 0 # tgcol5 <> 0 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol4 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1310,104 +1308,104 @@ class TDTestCase: ...@@ -1310,104 +1308,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step17 # TSIM: print =============== step17
tdLog.info('=============== step17') tdLog.info('=============== step17')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1417,104 +1415,104 @@ class TDTestCase: ...@@ -1417,104 +1415,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step18 # TSIM: print =============== step18
tdLog.info('=============== step18') tdLog.info('=============== step18')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1524,105 +1522,105 @@ class TDTestCase: ...@@ -1524,105 +1522,105 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step19 # TSIM: print =============== step19
tdLog.info('=============== step19') tdLog.info('=============== step19')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1632,106 +1630,106 @@ class TDTestCase: ...@@ -1632,106 +1630,106 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step20 # TSIM: print =============== step20
tdLog.info('=============== step20') tdLog.info('=============== step20')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and
# tgcol5 <> 0 # tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 and tgcol5 <> 0 # tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1844,12 +1842,12 @@ class TDTestCase: ...@@ -1844,12 +1842,12 @@ class TDTestCase:
# TSIM: print =============== step23 # TSIM: print =============== step23
tdLog.info('=============== step23') tdLog.info('=============== step23')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1860,13 +1858,13 @@ class TDTestCase: ...@@ -1860,13 +1858,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 # and tgcol1 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1877,13 +1875,13 @@ class TDTestCase: ...@@ -1877,13 +1875,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 # and tgcol1 = 1 and tgcol2 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1894,13 +1892,13 @@ class TDTestCase: ...@@ -1894,13 +1892,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1911,11 +1909,11 @@ class TDTestCase: ...@@ -1911,11 +1909,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -1926,11 +1924,11 @@ class TDTestCase: ...@@ -1926,11 +1924,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 # tgcol5 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2106,13 +2104,13 @@ class TDTestCase: ...@@ -2106,13 +2104,13 @@ class TDTestCase:
# TSIM: print =============== step26 # TSIM: print =============== step26
tdLog.info('=============== step26') tdLog.info('=============== step26')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol2 # group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2123,13 +2121,13 @@ class TDTestCase: ...@@ -2123,13 +2121,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 group by tgcol2 # and tgcol1 = 1 group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2140,13 +2138,13 @@ class TDTestCase: ...@@ -2140,13 +2138,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 # and tgcol1 = 1 and tgcol2 = 1 group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2157,11 +2155,11 @@ class TDTestCase: ...@@ -2157,11 +2155,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2172,11 +2170,11 @@ class TDTestCase: ...@@ -2172,11 +2170,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by
# tgcol2 # tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2186,11 +2184,11 @@ class TDTestCase: ...@@ -2186,11 +2184,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 group by tgcol2 # tgcol5 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
......
...@@ -79,14 +79,13 @@ class TDTestCase: ...@@ -79,14 +79,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -110,14 +109,13 @@ class TDTestCase: ...@@ -110,14 +109,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -136,36 +134,36 @@ class TDTestCase: ...@@ -136,36 +134,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -417,98 +415,98 @@ class TDTestCase: ...@@ -417,98 +415,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step9 # TSIM: print =============== step9
tdLog.info('=============== step9') tdLog.info('=============== step9')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -518,98 +516,98 @@ class TDTestCase: ...@@ -518,98 +516,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -619,98 +617,98 @@ class TDTestCase: ...@@ -619,98 +617,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 # tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -720,98 +718,98 @@ class TDTestCase: ...@@ -720,98 +718,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step12 # TSIM: print =============== step12
tdLog.info('=============== step12') tdLog.info('=============== step12')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -821,98 +819,98 @@ class TDTestCase: ...@@ -821,98 +819,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol5 <> 0 # tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -922,98 +920,98 @@ class TDTestCase: ...@@ -922,98 +920,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step14 # TSIM: print =============== step14
tdLog.info('=============== step14') tdLog.info('=============== step14')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol6 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol6 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol6 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol6 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol6 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol6 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol6 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol6 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol6 <> 0 # tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol6 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1023,104 +1021,104 @@ class TDTestCase: ...@@ -1023,104 +1021,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step15 # TSIM: print =============== step15
tdLog.info('=============== step15') tdLog.info('=============== step15')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol1 = 1 # tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol1 <> 1 # tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol1 = 0 # tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol1 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1130,104 +1128,104 @@ class TDTestCase: ...@@ -1130,104 +1128,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step16 # TSIM: print =============== step16
tdLog.info('=============== step16') tdLog.info('=============== step16')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol2 = 1 # tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol2 <> 1 # tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol2 = 0 # tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol2 <> 0 # tgcol3 <> 0 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1237,104 +1235,104 @@ class TDTestCase: ...@@ -1237,104 +1235,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step17 # TSIM: print =============== step17
tdLog.info('=============== step17') tdLog.info('=============== step17')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and
# tgcol4 = 1 # tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and
# tgcol4 <> 1 # tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol3 <> 0 and tgcol4 <> 0 # tgcol3 <> 0 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol3 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol4 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1344,104 +1342,104 @@ class TDTestCase: ...@@ -1344,104 +1342,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step18 # TSIM: print =============== step18
tdLog.info('=============== step18') tdLog.info('=============== step18')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and
# tgcol4 = 1 # tgcol4 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and
# tgcol4 <> 1 # tgcol4 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol4 = 0 # tgcol4 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol4 <> 0 # tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol5 <> 0 and tgcol4 <> 0 # tgcol5 <> 0 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol4 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1451,104 +1449,104 @@ class TDTestCase: ...@@ -1451,104 +1449,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step19 # TSIM: print =============== step19
tdLog.info('=============== step19') tdLog.info('=============== step19')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and
# tgcol6 = 1 # tgcol6 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol6 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol6 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and
# tgcol6 <> 1 # tgcol6 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol6 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol6 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol6 = 0 # tgcol6 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol6 <> 0 # tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and
# tgcol6 = 0 # tgcol6 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and
# tgcol6 <> 0 # tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol5 <> 0 and tgcol6 <> 0 # tgcol5 <> 0 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol5 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol6 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1558,104 +1556,104 @@ class TDTestCase: ...@@ -1558,104 +1556,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step20 # TSIM: print =============== step20
tdLog.info('=============== step20') tdLog.info('=============== step20')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol1 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1665,104 +1663,104 @@ class TDTestCase: ...@@ -1665,104 +1663,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step21 # TSIM: print =============== step21
tdLog.info('=============== step21') tdLog.info('=============== step21')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 # tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 # tgcol2 <> 1 and tgcol3 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 # tgcol2 = 0 and tgcol3 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 # tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1772,105 +1770,105 @@ class TDTestCase: ...@@ -1772,105 +1770,105 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step22 # TSIM: print =============== step22
tdLog.info('=============== step22') tdLog.info('=============== step22')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 # tgcol1 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1880,106 +1878,106 @@ class TDTestCase: ...@@ -1880,106 +1878,106 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step23 # TSIM: print =============== step23
tdLog.info('=============== step23') tdLog.info('=============== step23')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and
# tgcol5 <> 0 # tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 and tgcol5 <> 0 # tgcol1 <> 0 and tgcol5 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -1989,112 +1987,112 @@ class TDTestCase: ...@@ -1989,112 +1987,112 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step24 # TSIM: print =============== step24
tdLog.info('=============== step24') tdLog.info('=============== step24')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and
# tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 =
# 1 # 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and
# tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and
# tgcol6 <> 1 # tgcol6 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 =
# 0 # 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and
# tgcol6 <> 0 # tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and
# tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 =
# 0 # 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and
# tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and
# tgcol6 <> 0 # tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and
# tgcol5 <> 0 and tgcol6 <> 0 # tgcol5 <> 0 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol4 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and
# tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 # tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -2221,12 +2219,12 @@ class TDTestCase: ...@@ -2221,12 +2219,12 @@ class TDTestCase:
# TSIM: print =============== step27 # TSIM: print =============== step27
tdLog.info('=============== step27') tdLog.info('=============== step27')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2237,13 +2235,13 @@ class TDTestCase: ...@@ -2237,13 +2235,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 # and tgcol1 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2254,13 +2252,13 @@ class TDTestCase: ...@@ -2254,13 +2252,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 # and tgcol1 = 1 and tgcol2 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2271,13 +2269,13 @@ class TDTestCase: ...@@ -2271,13 +2269,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2288,11 +2286,11 @@ class TDTestCase: ...@@ -2288,11 +2286,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2303,11 +2301,11 @@ class TDTestCase: ...@@ -2303,11 +2301,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 # tgcol5 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2317,11 +2315,11 @@ class TDTestCase: ...@@ -2317,11 +2315,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 and tgcol6 = 1 # tgcol5 = 1 and tgcol6 = 1
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2527,13 +2525,13 @@ class TDTestCase: ...@@ -2527,13 +2525,13 @@ class TDTestCase:
# TSIM: print =============== step30 # TSIM: print =============== step30
tdLog.info('=============== step30') tdLog.info('=============== step30')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol2 # group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2544,13 +2542,13 @@ class TDTestCase: ...@@ -2544,13 +2542,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 group by tgcol2 # and tgcol1 = 1 group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2561,13 +2559,13 @@ class TDTestCase: ...@@ -2561,13 +2559,13 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 # and tgcol1 = 1 and tgcol2 = 1 group by tgcol2
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2578,11 +2576,11 @@ class TDTestCase: ...@@ -2578,11 +2576,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -2593,11 +2591,11 @@ class TDTestCase: ...@@ -2593,11 +2591,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by
# tgcol2 # tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2607,11 +2605,11 @@ class TDTestCase: ...@@ -2607,11 +2605,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 group by tgcol2 # tgcol5 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
...@@ -2621,11 +2619,11 @@ class TDTestCase: ...@@ -2621,11 +2619,11 @@ class TDTestCase:
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and
# tgcol5 = 1 and tgcol6 = 1 group by tgcol2 # tgcol5 = 1 and tgcol6 = 1 group by tgcol2
tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt))
tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
# TSIM: if $data00 != 25 then # TSIM: if $data00 != 25 then
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,98 +331,98 @@ class TDTestCase: ...@@ -333,98 +331,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> '0' # tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '0' and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -471,12 +469,12 @@ class TDTestCase: ...@@ -471,12 +469,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -526,13 +524,13 @@ class TDTestCase: ...@@ -526,13 +524,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -74,14 +74,13 @@ class TDTestCase: ...@@ -74,14 +74,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -102,14 +101,13 @@ class TDTestCase: ...@@ -102,14 +101,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -128,36 +126,36 @@ class TDTestCase: ...@@ -128,36 +126,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -269,98 +267,98 @@ class TDTestCase: ...@@ -269,98 +267,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> '0' # tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '0' and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -370,98 +368,98 @@ class TDTestCase: ...@@ -370,98 +368,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' # tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -471,104 +469,104 @@ class TDTestCase: ...@@ -471,104 +469,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1' and
# tgcol = '1' # tgcol = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1' and
# tgcol <> '1' # tgcol <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = '0' # tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0' and
# tgcol <> '0' # tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = '0' # tgcol = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
# and tgcol <> '0' # and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' and tgcol <> '0' # tgcol2 <> '0' and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> '0' # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -648,12 +646,12 @@ class TDTestCase: ...@@ -648,12 +646,12 @@ class TDTestCase:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -738,13 +736,13 @@ class TDTestCase: ...@@ -738,13 +736,13 @@ class TDTestCase:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -71,14 +71,13 @@ class TDTestCase: ...@@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -97,14 +96,13 @@ class TDTestCase: ...@@ -97,14 +96,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -123,81 +121,81 @@ class TDTestCase: ...@@ -123,81 +121,81 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -216,36 +214,36 @@ class TDTestCase: ...@@ -216,36 +214,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -324,98 +322,98 @@ class TDTestCase: ...@@ -324,98 +322,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < now + 5m # and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -462,12 +460,12 @@ class TDTestCase: ...@@ -462,12 +460,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -517,13 +515,13 @@ class TDTestCase: ...@@ -517,13 +515,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -71,14 +71,13 @@ class TDTestCase: ...@@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -96,14 +95,13 @@ class TDTestCase: ...@@ -96,14 +95,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -122,36 +120,36 @@ class TDTestCase: ...@@ -122,36 +120,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -263,98 +261,98 @@ class TDTestCase: ...@@ -263,98 +261,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < now + 5m # and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -364,98 +362,98 @@ class TDTestCase: ...@@ -364,98 +362,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' # tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -465,104 +463,104 @@ class TDTestCase: ...@@ -465,104 +463,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1' and
# tgcol = true # tgcol = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1' and
# tgcol <> true # tgcol <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = false # tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0' and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = false # tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
# and tgcol <> false # and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' and tgcol <> false # tgcol2 <> '0' and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> false # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -642,12 +640,12 @@ class TDTestCase: ...@@ -642,12 +640,12 @@ class TDTestCase:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -732,13 +730,13 @@ class TDTestCase: ...@@ -732,13 +730,13 @@ class TDTestCase:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -71,14 +71,13 @@ class TDTestCase: ...@@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -96,14 +95,13 @@ class TDTestCase: ...@@ -96,14 +95,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -122,36 +120,36 @@ class TDTestCase: ...@@ -122,36 +120,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -295,98 +293,98 @@ class TDTestCase: ...@@ -295,98 +293,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> true # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < now + 5m # and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> false and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> false and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -396,98 +394,98 @@ class TDTestCase: ...@@ -396,98 +394,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -497,104 +495,104 @@ class TDTestCase: ...@@ -497,104 +495,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol = true # tgcol = true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol = true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol = true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol = true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol <> true # tgcol <> true
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol <> true' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol <> true' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol <> true' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol = false # tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol = false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol = false # tgcol = false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol = false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol = false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol = false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol <> false # tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol <> false # tgcol2 <> 0 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> false # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> false' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -674,12 +672,12 @@ class TDTestCase: ...@@ -674,12 +672,12 @@ class TDTestCase:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -764,13 +762,13 @@ class TDTestCase: ...@@ -764,13 +762,13 @@ class TDTestCase:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -71,14 +71,13 @@ class TDTestCase: ...@@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -97,14 +96,13 @@ class TDTestCase: ...@@ -97,14 +96,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -123,56 +121,56 @@ class TDTestCase: ...@@ -123,56 +121,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -189,25 +187,25 @@ class TDTestCase: ...@@ -189,25 +187,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -226,36 +224,36 @@ class TDTestCase: ...@@ -226,36 +224,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -332,94 +330,94 @@ class TDTestCase: ...@@ -332,94 +330,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -466,12 +464,12 @@ class TDTestCase: ...@@ -466,12 +464,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -521,13 +519,13 @@ class TDTestCase: ...@@ -521,13 +519,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,36 +122,36 @@ class TDTestCase: ...@@ -124,36 +122,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -265,94 +263,94 @@ class TDTestCase: ...@@ -265,94 +263,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -362,98 +360,98 @@ class TDTestCase: ...@@ -362,98 +360,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' # tgcol2 <> '0'
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0"' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0"' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -463,104 +461,104 @@ class TDTestCase: ...@@ -463,104 +461,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = '1' and
# tgcol = 1 # tgcol = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1" and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1" and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '1' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '1' and
# tgcol <> 1 # tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1" and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1" and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = 0 # tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0" and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0" and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> '0' and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = '0' and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = '0' and
# tgcol = 0 # tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0" and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0" and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> '0' # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> '0'
# and tgcol <> 0 # and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> '0' and tgcol <> 0 # tgcol2 <> '0' and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> "0" and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> "0" and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "0" and ts < now + 5m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "0" and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -640,12 +638,12 @@ class TDTestCase: ...@@ -640,12 +638,12 @@ class TDTestCase:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -730,13 +728,13 @@ class TDTestCase: ...@@ -730,13 +728,13 @@ class TDTestCase:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,36 +122,36 @@ class TDTestCase: ...@@ -124,36 +122,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -301,94 +299,94 @@ class TDTestCase: ...@@ -301,94 +299,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -398,98 +396,98 @@ class TDTestCase: ...@@ -398,98 +396,98 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step6 # TSIM: print =============== step6
tdLog.info('=============== step6') tdLog.info('=============== step6')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 # tgcol2 <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m # ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -499,104 +497,104 @@ class TDTestCase: ...@@ -499,104 +497,104 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step7 # TSIM: print =============== step7
tdLog.info('=============== step7') tdLog.info('=============== step7')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and
# tgcol = 1 # tgcol = 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol = 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 1 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 1 and
# tgcol <> 1 # tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol = 0 # tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 = 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 = 0 and
# tgcol = 0 # tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol2 <> 0 and tgcol <> 0 # tgcol2 <> 0 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> 0 # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -676,12 +674,12 @@ class TDTestCase: ...@@ -676,12 +674,12 @@ class TDTestCase:
# TSIM: print =============== step10 # TSIM: print =============== step10
tdLog.info('=============== step10') tdLog.info('=============== step10')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -766,13 +764,13 @@ class TDTestCase: ...@@ -766,13 +764,13 @@ class TDTestCase:
# TSIM: print =============== step13 # TSIM: print =============== step13
tdLog.info('=============== step13') tdLog.info('=============== step13')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
...@@ -72,14 +72,13 @@ class TDTestCase: ...@@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -98,14 +97,13 @@ class TDTestCase: ...@@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum # TSIM: while $x < $rowNum
while (x < rowNum): while (x < rowNum):
# TSIM: $ms = $x . m # TSIM: $ms = $x . m
ms = "%dm" % x ms = x * 60000
# TSIM: sql insert into $tb values (now + $ms , $x )
tdLog.info( tdLog.info(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
tdSql.execute( tdSql.execute(
'insert into %s values (now + %s , %d )' % "insert into %s values (%d, %d)" %
(tb, ms, x)) (tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1 # TSIM: $x = $x + 1
x = x + 1 x = x + 1
# TSIM: endw # TSIM: endw
...@@ -124,56 +122,56 @@ class TDTestCase: ...@@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum) tdSql.checkRows(rowNum)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (tb)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m # TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= now + 4m' % (tb)) tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb)) tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (tb)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m # TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= now + 4m' % (tb)) tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb)) tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then # TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)') tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15) tdSql.checkRows(15)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1) tdSql.checkRows(1)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m and ts > now + 5m # TSIM: sql select * from $tb where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and ts > now + 5m' % 'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
...@@ -190,25 +188,25 @@ class TDTestCase: ...@@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts < now + 3m # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 3m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb)) (tb))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and # TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < now + 6m # ts < 1605045600000 + 360001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts > now + 5m and ts < now + 6m' % 'select * from %s where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and ts < 1605045600000 + 360001' %
(tb)) (tb))
# TSIM: if $rows != 1 then # TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)') tdLog.info('tdSql.checkRow(1)')
...@@ -227,36 +225,36 @@ class TDTestCase: ...@@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: # TSIM:
# TSIM: sql select * from $mt where ts < now + 4m # TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < now + 4m' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt)) tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then # TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)') tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50) tdSql.checkRows(50)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > now + 4m' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt)) tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then # TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)') tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150) tdSql.checkRows(150)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m # TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = now + 4m' % (mt)) tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt)) tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then # TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)') tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0) tdSql.checkRows(0)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 10 then # TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)') tdLog.info('tdSql.checkRow(10)')
...@@ -333,94 +331,94 @@ class TDTestCase: ...@@ -333,94 +331,94 @@ class TDTestCase:
# TSIM: # TSIM:
# TSIM: print =============== step5 # TSIM: print =============== step5
tdLog.info('=============== step5') tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt)) tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 1 # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 1
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt)) (mt))
# TSIM: if $rows != 75 then # TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)') tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75) tdSql.checkRows(75)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt)) tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' % 'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol = 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol = 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts <= now + 4m and tgcol <> 0 # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' % 'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 25 then # TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)') tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25) tdSql.checkRows(25)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and ts < now + 5m and # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and
# tgcol <> 0 # tgcol <> 0
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and ts < now + 5m and tgcol <> 0' % 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol <> 0' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5) tdSql.checkRows(5)
# TSIM: return -1 # TSIM: return -1
# TSIM: endi # TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < now + 5m # < 1605045600000 + 300001
tdLog.info( tdLog.info(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 0 and ts < now + 5m' % 'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 0 and ts < 1605045600000 + 300001' %
(mt)) (mt))
# TSIM: if $rows != 5 then # TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)') tdLog.info('tdSql.checkRow(5)')
...@@ -467,12 +465,12 @@ class TDTestCase: ...@@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8 # TSIM: print =============== step8
tdLog.info('=============== step8') tdLog.info('=============== step8')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
...@@ -522,13 +520,13 @@ class TDTestCase: ...@@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11 # TSIM: print =============== step11
tdLog.info('=============== step11') tdLog.info('=============== step11')
# TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol),
# max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001
# group by tgcol # group by tgcol
tdLog.info( tdLog.info(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
tdSql.query( tdSql.query(
'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol' % 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol' %
(mt)) (mt))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册