[TD-4553]<test>fix timestamp error

This commit is contained in:
liuyq-617 2021-06-08 08:05:08 +00:00
parent c99a639c79
commit 5511dcb0c7
21 changed files with 2848 additions and 2887 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,98 +331,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '0' and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -471,12 +469,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -526,13 +524,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -74,14 +74,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -102,14 +101,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -128,36 +126,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -269,98 +267,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> '0' and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> '0' and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -370,98 +368,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -471,104 +469,104 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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'
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> '0'
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> '0'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -648,12 +646,12 @@ class TDTestCase:
# TSIM: print =============== step10
tdLog.info('=============== step10')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -738,13 +736,13 @@ class TDTestCase:
# TSIM: print =============== step13
tdLog.info('=============== step13')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -97,14 +96,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -123,81 +121,81 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -216,36 +214,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -324,98 +322,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -462,12 +460,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -517,13 +515,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -96,14 +95,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -122,36 +120,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -263,98 +261,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -364,98 +362,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -465,104 +463,104 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> false
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -642,12 +640,12 @@ class TDTestCase:
# TSIM: print =============== step10
tdLog.info('=============== step10')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -732,13 +730,13 @@ class TDTestCase:
# TSIM: print =============== step13
tdLog.info('=============== step13')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -96,14 +95,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -122,36 +120,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -295,98 +293,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> true' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> true' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> false' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> false' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> false' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> false
# and ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> false
# and ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -396,98 +394,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol2 = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -497,104 +495,104 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> false
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> false
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -674,12 +672,12 @@ class TDTestCase:
# TSIM: print =============== step10
tdLog.info('=============== step10')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -764,13 +762,13 @@ class TDTestCase:
# TSIM: print =============== step13
tdLog.info('=============== step13')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -71,14 +71,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -97,14 +96,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -123,56 +121,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -189,25 +187,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -226,36 +224,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -332,94 +330,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -466,12 +464,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -521,13 +519,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,36 +122,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -265,94 +263,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -362,98 +360,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> "1"' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> "1"' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> "0"' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> "0"' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> "0"' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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'
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -463,104 +461,104 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> '0' and
# ts < now + 5m and ts < now + 5m and tgcol <> 0
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> '0' and
# ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -640,12 +638,12 @@ class TDTestCase:
# TSIM: print =============== step10
tdLog.info('=============== step10')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -730,13 +728,13 @@ class TDTestCase:
# TSIM: print =============== step13
tdLog.info('=============== step13')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,36 +122,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -301,94 +299,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -398,98 +396,98 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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(
'select * from %s where ts > now + 4m and tgcol2 = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol2 <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol2 <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol2 <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -499,104 +497,104 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol2 <> 0 and
# ts < now + 5m and ts < now + 5m and tgcol <> 0
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and
# ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol <> 0
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -676,12 +674,12 @@ class TDTestCase:
# TSIM: print =============== step10
tdLog.info('=============== step10')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -766,13 +764,13 @@ class TDTestCase:
# TSIM: print =============== step13
tdLog.info('=============== step13')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')

View File

@ -72,14 +72,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -98,14 +97,13 @@ class TDTestCase:
# TSIM: while $x < $rowNum
while (x < rowNum):
# TSIM: $ms = $x . m
ms = "%dm" % x
# TSIM: sql insert into $tb values (now + $ms , $x )
ms = x * 60000
tdLog.info(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
tdSql.execute(
'insert into %s values (now + %s , %d )' %
(tb, ms, x))
"insert into %s values (%d, %d)" %
(tb, 1605045600000 + ms, x))
# TSIM: $x = $x + 1
x = x + 1
# TSIM: endw
@ -124,56 +122,56 @@ class TDTestCase:
tdSql.checkRows(rowNum)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (tb))
tdSql.query('select * from %s where ts < now + 4m' % (tb))
# TSIM: sql select * from $tb where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts <= now + 4m
tdLog.info('select * from %s where ts <= now + 4m' % (tb))
tdSql.query('select * from %s where ts <= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts <= 1605045600000 + 240001
tdLog.info('select * from %s where ts <= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts <= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (tb))
tdSql.query('select * from %s where ts > now + 4m' % (tb))
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts >= now + 4m
tdLog.info('select * from %s where ts >= now + 4m' % (tb))
tdSql.query('select * from %s where ts >= now + 4m' % (tb))
# TSIM: sql select * from $tb where ts >= 1605045600000 + 240001
tdLog.info('select * from %s where ts >= 1605045600000 + 240001' % (tb))
tdSql.query('select * from %s where ts >= 1605045600000 + 240001' % (tb))
# TSIM: if $rows != 15 then
tdLog.info('tdSql.checkRow(15)')
tdSql.checkRows(15)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
tdSql.checkRows(1)
# TSIM: return -1
# 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(
'select * from %s where ts < now + 4m and ts > now + 5m' %
'select * from %s where ts < 1605045600000 + 240001 and ts > 1605045600000 + 300001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
@ -190,25 +188,25 @@ class TDTestCase:
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 3m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 180001' %
(tb))
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))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $tb where ts > now + 4m and ts > now + 5m and
# ts < now + 6m
# TSIM: sql select * from $tb where ts > 1605045600000 + 240001 and ts > 1605045600000 + 300001 and
# ts < 1605045600000 + 360001
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))
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))
# TSIM: if $rows != 1 then
tdLog.info('tdSql.checkRow(1)')
@ -227,36 +225,36 @@ class TDTestCase:
# TSIM: return -1
# TSIM: endi
# TSIM:
# TSIM: sql select * from $mt where ts < now + 4m
tdLog.info('select * from %s where ts < now + 4m' % (mt))
tdSql.query('select * from %s where ts < now + 4m' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001
tdLog.info('select * from %s where ts < 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts < 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 50 then
tdLog.info('tdSql.checkRow(50)')
tdSql.checkRows(50)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m
tdLog.info('select * from %s where ts > now + 4m' % (mt))
tdSql.query('select * from %s where ts > now + 4m' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001
tdLog.info('select * from %s where ts > 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts > 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 150 then
tdLog.info('tdSql.checkRow(150)')
tdSql.checkRows(150)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts = now + 4m
tdLog.info('select * from %s where ts = now + 4m' % (mt))
tdSql.query('select * from %s where ts = now + 4m' % (mt))
# TSIM: sql select * from $mt where ts = 1605045600000 + 240001
tdLog.info('select * from %s where ts = 1605045600000 + 240001' % (mt))
tdSql.query('select * from %s where ts = 1605045600000 + 240001' % (mt))
# TSIM: if $rows != 0 then
tdLog.info('tdSql.checkRow(0)')
tdSql.checkRows(0)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and ts < now + 5m' %
'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001' %
(mt))
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))
# TSIM: if $rows != 10 then
tdLog.info('tdSql.checkRow(10)')
@ -333,94 +331,94 @@ class TDTestCase:
# TSIM:
# TSIM: print =============== step5
tdLog.info('=============== step5')
# TSIM: sql select * from $mt where ts > now + 4m and tgcol = 1
tdLog.info('select * from %s where ts > now + 4m and tgcol = 1' % (mt))
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol = 1
tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' % (mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol = 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol = 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# 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(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
tdSql.query(
'select * from %s where ts > now + 4m and tgcol <> 1' %
'select * from %s where ts > 1605045600000 + 240001 and tgcol <> 1' %
(mt))
# TSIM: if $rows != 75 then
tdLog.info('tdSql.checkRow(75)')
tdSql.checkRows(75)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts < now + 4m and tgcol = 0
tdLog.info('select * from %s where ts < now + 4m and tgcol = 0' % (mt))
# TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol = 0
tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' % (mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol = 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts < now + 4m and tgcol <> 0' %
'select * from %s where ts < 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol = 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol = 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
tdSql.query(
'select * from %s where ts <= now + 4m and tgcol <> 0' %
'select * from %s where ts <= 1605045600000 + 240001 and tgcol <> 0' %
(mt))
# TSIM: if $rows != 25 then
tdLog.info('tdSql.checkRow(25)')
tdSql.checkRows(25)
# TSIM: return -1
# 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
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
tdSql.checkRows(5)
# TSIM: return -1
# TSIM: endi
# TSIM: sql select * from $mt where ts > now + 4m and tgcol <> 0 and ts
# < now + 5m
# TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol <> 0 and ts
# < 1605045600000 + 300001
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))
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))
# TSIM: if $rows != 5 then
tdLog.info('tdSql.checkRow(5)')
@ -467,12 +465,12 @@ class TDTestCase:
# TSIM: print =============== step8
tdLog.info('=============== step8')
# 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(
'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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')
@ -522,13 +520,13 @@ class TDTestCase:
# TSIM: print =============== step11
tdLog.info('=============== step11')
# 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
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))
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))
# TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06
tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06')