From 5511dcb0c7f144a16fe412ea9a8cb501e849d4cc Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Tue, 8 Jun 2021 08:05:08 +0000 Subject: [PATCH 1/9] [TD-4553]fix timestamp error --- tests/pytest/tag_lite/3.py | 444 +++++------ tests/pytest/tag_lite/4.py | 657 ++++++++------- tests/pytest/tag_lite/5.py | 768 +++++++++--------- tests/pytest/tag_lite/6.py | 930 +++++++++++----------- tests/pytest/tag_lite/bigint.py | 158 ++-- tests/pytest/tag_lite/binary.py | 158 ++-- tests/pytest/tag_lite/binary_binary.py | 208 +++-- tests/pytest/tag_lite/bool.py | 158 ++-- tests/pytest/tag_lite/bool_binary.py | 208 +++-- tests/pytest/tag_lite/bool_int.py | 208 +++-- tests/pytest/tag_lite/double.py | 158 ++-- tests/pytest/tag_lite/float.py | 158 ++-- tests/pytest/tag_lite/int.py | 158 ++-- tests/pytest/tag_lite/int_binary.py | 208 +++-- tests/pytest/tag_lite/int_float.py | 208 +++-- tests/pytest/tag_lite/smallint.py | 158 ++-- tests/pytest/tag_lite/tinyint.py | 158 ++-- tests/pytest/tag_lite/unsignedBigint.py | 158 ++-- tests/pytest/tag_lite/unsignedInt.py | 158 ++-- tests/pytest/tag_lite/unsignedSmallint.py | 158 ++-- tests/pytest/tag_lite/unsignedTinyint.py | 158 ++-- 21 files changed, 2848 insertions(+), 2887 deletions(-) diff --git a/tests/pytest/tag_lite/3.py b/tests/pytest/tag_lite/3.py index 373db1c70f..bbdf0868fa 100644 --- a/tests/pytest/tag_lite/3.py +++ b/tests/pytest/tag_lite/3.py @@ -60,14 +60,14 @@ class TDTestCase: x = 0 while (x < rowNum): - ms = "%dm" % x - # TSIM: sql insert into $tb values (now + $ms , $x ) + ms = x * 60000 + # TSIM: sql insert into $tb values (1605045600000 + $ms , $x ) 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)) x = x + 1 # TSIM: endw i = i + 1 @@ -81,13 +81,13 @@ class TDTestCase: (tb, mt)) x = 0 while (x < rowNum): - ms = "%dm" % 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)) x = x + 1 # TSIM: endw i = i + 1 @@ -104,36 +104,36 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: - # TSIM: sql select * from %s 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 %s 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 %s 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 %s 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 %s 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 %s 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 %s where ts > now + 4m and ts < now + 5m + # TSIM: sql select * from %s 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) tdLog.info('tdSql.checkRow(10)') tdSql.checkRows(10) @@ -267,91 +267,91 @@ class TDTestCase: # TSIM: # TSIM: print =============== step6 tdLog.info('=============== step6') - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 = true + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = true' % mt) tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> true + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> true' % mt) tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 = false + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = false' % mt) tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> false + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> false' % mt) tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = false + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = false' % mt) tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> false + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> false' % mt) tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol1 <> false tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> false - # and ts < now + 5m + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false + # and ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> false and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false and ts < 1605045600000 + 300001' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> false and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> false and ts < 1605045600000 + 300001' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -361,84 +361,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step7 tdLog.info('=============== step7') - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt) + tdSql.query('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 %s where ts > now + 4m and tgcol2 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol2 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1' % + '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 %s where ts < now + 4m and tgcol2 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt) + tdSql.query('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 %s where ts < now + 4m and tgcol2 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol2 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0' % + '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 %s where ts <= now + 4m and tgcol2 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol2 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0' % + '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 %s where ts <= now + 4m and tgcol2 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0' % + '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 %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol2 <> 0 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 %s where ts > now + 4m and tgcol2 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s 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)') @@ -448,84 +448,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step8 tdLog.info('=============== step8') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt) + tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol3 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt) + tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol3 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol3 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -535,104 +535,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step9 tdLog.info('=============== step9') - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and # tgcol1 = true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = true' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and # tgcol1 <> true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> true' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and # tgcol1 = false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and # tgcol1 <> false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and # tgcol1 = false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and # tgcol1 <> false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol2 <> 0 and tgcol1 <> false tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol1 <> false + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -642,104 +642,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step10 tdLog.info('=============== step10') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol1 = true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = true' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol1 <> true tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> true' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> true' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> true' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol1 = false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol1 <> false tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol1 = false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol1 <> false tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 and tgcol1 <> false tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> false' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol1 <> false + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> false' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> false' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -749,104 +749,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step11 tdLog.info('=============== step11') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol2 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol2 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -856,104 +856,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step12 tdLog.info('=============== step12') - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1034,12 +1034,12 @@ class TDTestCase: # TSIM: print =============== step15 tdLog.info('=============== step15') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 tdLog.info( - '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') @@ -1050,13 +1050,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1067,13 +1067,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true and tgcol2 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1084,11 +1084,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1204,13 +1204,13 @@ class TDTestCase: # TSIM: print =============== step18 tdLog.info('=============== step18') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 # group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1221,13 +1221,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1238,11 +1238,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true and tgcol2 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1253,10 +1253,10 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = true and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then diff --git a/tests/pytest/tag_lite/4.py b/tests/pytest/tag_lite/4.py index aae930ecdf..df81dd8100 100644 --- a/tests/pytest/tag_lite/4.py +++ b/tests/pytest/tag_lite/4.py @@ -64,14 +64,14 @@ class TDTestCase: (tb, mt)) x = 0 while (x < rowNum): - ms = "%dm" % x - # TSIM: sql insert into $tb values (now + $ms , $x ) + ms = x * 60000 + # TSIM: sql insert into $tb values (1605045600000 + $ms , $x ) 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)) x = x + 1 # TSIM: endw i = i + 1 @@ -87,14 +87,13 @@ class TDTestCase: (tb, mt)) x = 0 while (x < rowNum): - 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)) x = x + 1 # TSIM: endw i = i + 1 @@ -111,36 +110,36 @@ class TDTestCase: # TSIM: return -1 # TSIM: endi # TSIM: - # TSIM: sql select * from %s 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 %s 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 %s 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 %s 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 %s 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 %s 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 %s where ts > now + 4m and ts < now + 5m + # TSIM: sql select * from %s 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)') @@ -322,84 +321,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step7 tdLog.info('=============== step7') - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol1 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol1 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % mt) + tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol1 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol1 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol1 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % mt) + tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol1 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol1 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts + # < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -409,84 +408,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step8 tdLog.info('=============== step8') - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol2 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1' % mt) + tdSql.query('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 %s where ts > now + 4m and tgcol2 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol2 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1' % + '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 %s where ts < now + 4m and tgcol2 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol2 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0' % mt) + tdSql.query('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 %s where ts < now + 4m and tgcol2 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol2 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0' % + '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 %s where ts <= now + 4m and tgcol2 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol2 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0' % + '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 %s where ts <= now + 4m and tgcol2 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0' % + '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 %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol2 <> 0 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 %s where ts > now + 4m and tgcol2 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s 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)') @@ -496,84 +495,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step9 tdLog.info('=============== step9') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol3 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt) + tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol3 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol3 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt) + tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol3 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol3 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -583,84 +582,84 @@ class TDTestCase: # TSIM: # TSIM: print =============== step10 tdLog.info('=============== step10') - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol4 = 1' % mt) - tdSql.query('select * from %s where ts > now + 4m and tgcol4 = 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % mt) + tdSql.query('select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 - tdLog.info('select * from %s where ts > now + 4m and tgcol4 <> 1' % mt) + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 + tdLog.info('select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol4 = 0' % mt) - tdSql.query('select * from %s where ts < now + 4m and tgcol4 = 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % mt) + tdSql.query('select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 - tdLog.info('select * from %s where ts < now + 4m and tgcol4 <> 0' % mt) + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 + tdLog.info('select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 - tdLog.info('select * from %s where ts <= now + 4m and tgcol4 = 0' % mt) + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 + tdLog.info('select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts - # < now + 5m + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts + # < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -670,104 +669,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step11 tdLog.info('=============== step11') - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and # tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and # tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol2 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and # tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol2 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol2 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and # tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol2 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol2 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol2 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol1 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -777,104 +776,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step12 tdLog.info('=============== step12') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol1 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol1 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol1 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -884,104 +883,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step13 tdLog.info('=============== step13') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol2 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol2 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -991,104 +990,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step14 tdLog.info('=============== step14') - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol3 <> 0 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol3 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol4 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1098,104 +1097,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step15 tdLog.info('=============== step15') - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol1 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol1 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol1 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1205,104 +1204,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step16 tdLog.info('=============== step16') - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1312,105 +1311,105 @@ class TDTestCase: # TSIM: # TSIM: print =============== step17 tdLog.info('=============== step17') - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 1 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % mt) # TSIM: if $rows != 75 then tdLog.info('tdSql.checkRow(75)') tdSql.checkRows(75) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 = 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts < now + 4m and tgcol4 <> 0 and + # TSIM: sql select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 = 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts <= now + 4m and tgcol4 <> 0 and + # TSIM: sql select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 25 then tdLog.info('tdSql.checkRow(25)') tdSql.checkRows(25) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and ts < now + 5m and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') tdSql.checkRows(5) # TSIM: return -1 # TSIM: endi - # TSIM: sql select * from %s where ts > now + 4m and tgcol4 <> 0 and ts - # < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts + # < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % mt) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1508,12 +1507,12 @@ class TDTestCase: # TSIM: print =============== step20 tdLog.info('=============== step20') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 tdLog.info( - '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') @@ -1524,13 +1523,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1541,13 +1540,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1558,13 +1557,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1575,10 +1574,10 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -1722,13 +1721,13 @@ class TDTestCase: # TSIM: print =============== step23 tdLog.info('=============== step23') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 # group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1739,13 +1738,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1756,11 +1755,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % mt) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1771,10 +1770,10 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -1784,11 +1783,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and + # max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and # tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % mt) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then diff --git a/tests/pytest/tag_lite/5.py b/tests/pytest/tag_lite/5.py index b3608bebee..28c8fc125a 100644 --- a/tests/pytest/tag_lite/5.py +++ b/tests/pytest/tag_lite/5.py @@ -76,14 +76,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 @@ -105,14 +104,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 @@ -131,36 +129,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)') @@ -377,98 +375,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step8 tdLog.info('=============== step8') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 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 tgcol1 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 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 tgcol1 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -478,98 +476,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step9 tdLog.info('=============== step9') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 tdLog.info( - '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)') @@ -579,98 +577,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step10 tdLog.info('=============== step10') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 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 tgcol3 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 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 tgcol3 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 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 # tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -680,98 +678,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step11 tdLog.info('=============== step11') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 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 tgcol4 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 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 tgcol4 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 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 # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -781,98 +779,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step12 tdLog.info('=============== step12') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 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 tgcol5 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 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 tgcol5 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 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 # tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' % (mt)) # 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 tgcol5 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -882,104 +880,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step13 tdLog.info('=============== step13') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and # tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % (mt)) # 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 # tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % (mt)) # 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 # tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) # 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 # tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) # 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -989,104 +987,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step14 tdLog.info('=============== step14') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol2 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % (mt)) # 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 tgcol3 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol2 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 # tgcol3 <> 0 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1096,104 +1094,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step15 tdLog.info('=============== step15') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % (mt)) # 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 tgcol3 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 # tgcol3 <> 0 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol4 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1203,104 +1201,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step16 tdLog.info('=============== step16') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and # tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' % (mt)) # 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 tgcol5 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and # tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 # tgcol5 <> 0 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol5 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol4 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1310,104 +1308,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step17 tdLog.info('=============== step17') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # 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 tgcol1 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) # 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 tgcol1 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol1 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol1 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol1 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol1 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1417,104 +1415,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step18 tdLog.info('=============== step18') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1524,105 +1522,105 @@ class TDTestCase: # TSIM: # TSIM: print =============== step19 tdLog.info('=============== step19') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1632,106 +1630,106 @@ class TDTestCase: # TSIM: # TSIM: print =============== step20 tdLog.info('=============== step20') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1844,12 +1842,12 @@ class TDTestCase: # TSIM: print =============== step23 tdLog.info('=============== step23') # 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') @@ -1860,13 +1858,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1877,13 +1875,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1894,13 +1892,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1911,11 +1909,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -1926,11 +1924,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2106,13 +2104,13 @@ class TDTestCase: # TSIM: print =============== step26 tdLog.info('=============== step26') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2123,13 +2121,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2140,13 +2138,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2157,11 +2155,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2172,11 +2170,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2186,11 +2184,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then diff --git a/tests/pytest/tag_lite/6.py b/tests/pytest/tag_lite/6.py index b789e41794..5cf43f1047 100644 --- a/tests/pytest/tag_lite/6.py +++ b/tests/pytest/tag_lite/6.py @@ -79,14 +79,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 @@ -110,14 +109,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 @@ -136,36 +134,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)') @@ -417,98 +415,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step9 tdLog.info('=============== step9') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 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 tgcol1 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 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 tgcol1 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -518,98 +516,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step10 tdLog.info('=============== step10') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 tdLog.info( - '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)') @@ -619,98 +617,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step11 tdLog.info('=============== step11') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 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 tgcol3 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 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 tgcol3 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 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 tgcol3 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 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 # tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -720,98 +718,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step12 tdLog.info('=============== step12') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 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 tgcol4 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 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 tgcol4 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 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 tgcol4 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 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 # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -821,98 +819,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step13 tdLog.info('=============== step13') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 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 tgcol5 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 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 tgcol5 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 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 tgcol5 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 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 # tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0' % (mt)) # 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 tgcol5 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -922,98 +920,98 @@ class TDTestCase: # TSIM: # TSIM: print =============== step14 tdLog.info('=============== step14') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol6 = 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 = 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 tgcol6 <> 1 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 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 tgcol6 = 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol6 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 = 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 tgcol6 <> 0 + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol6 <> 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 tgcol6 = 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol6 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 = 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 tgcol6 <> 0 + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol6 <> 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 # tgcol6 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' % (mt)) # 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 tgcol6 <> 0 and - # ts < now + 5m + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol6 <> 0 and + # ts < 1605045600000 + 300001 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 0 and ts < 1605045600000 + 300001' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol6 <> 0 and ts < now + 5m' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol6 <> 0 and ts < 1605045600000 + 300001' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1023,104 +1021,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step15 tdLog.info('=============== step15') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol2 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 = 1 and # tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 = 1 and tgcol1 = 1' % (mt)) # 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 # tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 1 and tgcol1 <> 1' % (mt)) # 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 # tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) # 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 # tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 = 0 and tgcol1 = 0' % (mt)) # 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 # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol2 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol1 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol2 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol2 <> 0 and ts < now + 5m and ts < now + 5m and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol2 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol1 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1130,104 +1128,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step16 tdLog.info('=============== step16') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol2 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol2 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol2 = 1' % (mt)) # 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 tgcol3 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol2 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol2 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol2 <> 1' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol2 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol2 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol2 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol2 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 # tgcol3 <> 0 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol2 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1237,104 +1235,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step17 tdLog.info('=============== step17') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol3 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 = 1 and # tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 = 1 and tgcol4 = 1' % (mt)) # 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 tgcol3 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 1 and # tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 1 and tgcol4 <> 1' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol3 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 # tgcol3 <> 0 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol3 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol3 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol3 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol4 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol3 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol3 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol3 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1344,104 +1342,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step18 tdLog.info('=============== step18') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and # tgcol4 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol4 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol4 = 1' % (mt)) # 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 tgcol5 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and # tgcol4 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol4 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol4 <> 1' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and # tgcol4 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol4 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol4 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol4 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 # tgcol5 <> 0 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol4 <> 0' % (mt)) # 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 tgcol5 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol4 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol4 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol4 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1451,104 +1449,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step19 tdLog.info('=============== step19') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol5 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 = 1 and # tgcol6 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol6 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 = 1 and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 = 1 and tgcol6 = 1' % (mt)) # 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 tgcol5 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 1 and # tgcol6 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol6 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 1 and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 1 and tgcol6 <> 1' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 = 0 and # tgcol6 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol6 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 tgcol5 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 = 0 and # tgcol6 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 = 0 and tgcol6 = 0' % (mt)) # 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 tgcol5 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and # tgcol6 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 # tgcol5 <> 0 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 tgcol5 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol6 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol5 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol5 <> 0 and ts < now + 5m and ts < now + 5m and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol5 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol6 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1558,104 +1556,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step20 tdLog.info('=============== step20') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol1 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # 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 tgcol1 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) # 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 tgcol1 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol1 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol1 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol1 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 # tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol1 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol1 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol1 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol1 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol1 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1665,104 +1663,104 @@ class TDTestCase: # TSIM: # TSIM: print =============== step21 tdLog.info('=============== step21') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1772,105 +1770,105 @@ class TDTestCase: # TSIM: # TSIM: print =============== step22 tdLog.info('=============== step22') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1880,106 +1878,106 @@ class TDTestCase: # TSIM: # TSIM: print =============== step23 tdLog.info('=============== step23') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 and tgcol5 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -1989,112 +1987,112 @@ class TDTestCase: # TSIM: # TSIM: print =============== step24 tdLog.info('=============== step24') - # TSIM: sql select * from $mt where ts > now + 4m and tgcol4 = 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 = 1 and # tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = # 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol1 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) # 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 tgcol4 <> 1 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 1 and # tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and # tgcol6 <> 1 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 1 and tgcol2 <> 1 and tgcol3 <> 1 and tgcol1 <> 1 and tgcol5 <> 1 and tgcol6 <> 1' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = # 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts < 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and # tgcol6 <> 0 tdLog.info( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts < now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts < 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 tgcol4 = 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 = 0 and # tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = # 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 = 0 and tgcol2 = 0 and tgcol3 = 0 and tgcol1 = 0 and tgcol5 = 0 and tgcol6 = 0' % (mt)) # 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 tgcol4 <> 0 and + # TSIM: sql select * from $mt where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and # tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and # tgcol6 <> 0 tdLog.info( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts <= now + 4m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts <= 1605045600000 + 240001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 # tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and # tgcol5 <> 0 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and ts < now + 5m and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and ts < 1605045600000 + 300001 and tgcol4 <> 0 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # 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 tgcol4 <> 0 and - # ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and + # TSIM: sql select * from $mt where ts > 1605045600000 + 240001 and tgcol4 <> 0 and + # ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and # tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0 tdLog.info( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) tdSql.query( - 'select * from %s where ts > now + 4m and tgcol4 <> 0 and ts < now + 5m and ts < now + 5m and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % + 'select * from %s where ts > 1605045600000 + 240001 and tgcol4 <> 0 and ts < 1605045600000 + 300001 and ts < 1605045600000 + 300001 and tgcol2 <> 0 and tgcol3 <> 0 and tgcol1 <> 0 and tgcol5 <> 0 and tgcol6 <> 0' % (mt)) # TSIM: if $rows != 5 then tdLog.info('tdSql.checkRow(5)') @@ -2221,12 +2219,12 @@ class TDTestCase: # TSIM: print =============== step27 tdLog.info('=============== step27') # 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') @@ -2237,13 +2235,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2254,13 +2252,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2271,13 +2269,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2288,11 +2286,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2303,11 +2301,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2317,11 +2315,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 and tgcol6 = 1 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2527,13 +2525,13 @@ class TDTestCase: # TSIM: print =============== step30 tdLog.info('=============== step30') # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2544,13 +2542,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2561,13 +2559,13 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 group by tgcol2 tdLog.info( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2578,11 +2576,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) tdSql.query( - 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % + 'select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') @@ -2593,11 +2591,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by # tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2607,11 +2605,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then @@ -2621,11 +2619,11 @@ class TDTestCase: # TSIM: endi # TSIM: # TSIM: sql select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), - # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < now + 4m + # max(tbcol), first(tbcol), last(tbcol) from $mt where ts < 1605045600000 + 240001 # and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and # tgcol5 = 1 and tgcol6 = 1 group by tgcol2 - tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) - tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < now + 4m and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) + tdLog.info('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) + tdSql.query('select count(tbcol), avg(tbcol), sum(tbcol), min(tbcol), max(tbcol), first(tbcol), last(tbcol) from %s where ts < 1605045600000 + 240001 and tgcol1 = 1 and tgcol2 = 1 and tgcol3 = 1 and tgcol4 = 1 and tgcol5 = 1 and tgcol6 = 1 group by tgcol2' % (mt)) # TSIM: print $data00 $data01 $data02 $data03 $data04 $data05 $data06 tdLog.info('$data00 $data01 $data02 $data03 $data04 $data05 $data06') # TSIM: if $data00 != 25 then diff --git a/tests/pytest/tag_lite/bigint.py b/tests/pytest/tag_lite/bigint.py index f83961aaad..733d30983d 100644 --- a/tests/pytest/tag_lite/bigint.py +++ b/tests/pytest/tag_lite/bigint.py @@ -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') diff --git a/tests/pytest/tag_lite/binary.py b/tests/pytest/tag_lite/binary.py index 4cbae63bec..3825c6637f 100644 --- a/tests/pytest/tag_lite/binary.py +++ b/tests/pytest/tag_lite/binary.py @@ -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') diff --git a/tests/pytest/tag_lite/binary_binary.py b/tests/pytest/tag_lite/binary_binary.py index 9c789eafd6..2a76238f59 100644 --- a/tests/pytest/tag_lite/binary_binary.py +++ b/tests/pytest/tag_lite/binary_binary.py @@ -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') diff --git a/tests/pytest/tag_lite/bool.py b/tests/pytest/tag_lite/bool.py index 6f2afd2625..11ce9eb7f8 100644 --- a/tests/pytest/tag_lite/bool.py +++ b/tests/pytest/tag_lite/bool.py @@ -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') diff --git a/tests/pytest/tag_lite/bool_binary.py b/tests/pytest/tag_lite/bool_binary.py index bfc496e8e4..934d91c908 100644 --- a/tests/pytest/tag_lite/bool_binary.py +++ b/tests/pytest/tag_lite/bool_binary.py @@ -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') diff --git a/tests/pytest/tag_lite/bool_int.py b/tests/pytest/tag_lite/bool_int.py index f7bfc7acef..1e857192ed 100644 --- a/tests/pytest/tag_lite/bool_int.py +++ b/tests/pytest/tag_lite/bool_int.py @@ -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') diff --git a/tests/pytest/tag_lite/double.py b/tests/pytest/tag_lite/double.py index b1f29f592e..c9d3a5af9e 100644 --- a/tests/pytest/tag_lite/double.py +++ b/tests/pytest/tag_lite/double.py @@ -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') diff --git a/tests/pytest/tag_lite/float.py b/tests/pytest/tag_lite/float.py index 7b93cb0ac9..589df89ab9 100644 --- a/tests/pytest/tag_lite/float.py +++ b/tests/pytest/tag_lite/float.py @@ -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') diff --git a/tests/pytest/tag_lite/int.py b/tests/pytest/tag_lite/int.py index d5a6917389..1297d083a0 100644 --- a/tests/pytest/tag_lite/int.py +++ b/tests/pytest/tag_lite/int.py @@ -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') diff --git a/tests/pytest/tag_lite/int_binary.py b/tests/pytest/tag_lite/int_binary.py index 7760814f66..6ce9a9a431 100644 --- a/tests/pytest/tag_lite/int_binary.py +++ b/tests/pytest/tag_lite/int_binary.py @@ -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') diff --git a/tests/pytest/tag_lite/int_float.py b/tests/pytest/tag_lite/int_float.py index 31c94130ab..341acfd5ae 100644 --- a/tests/pytest/tag_lite/int_float.py +++ b/tests/pytest/tag_lite/int_float.py @@ -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') diff --git a/tests/pytest/tag_lite/smallint.py b/tests/pytest/tag_lite/smallint.py index c060e3f82b..93fde22ca9 100644 --- a/tests/pytest/tag_lite/smallint.py +++ b/tests/pytest/tag_lite/smallint.py @@ -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') diff --git a/tests/pytest/tag_lite/tinyint.py b/tests/pytest/tag_lite/tinyint.py index 089dd46569..fc4af4ee96 100644 --- a/tests/pytest/tag_lite/tinyint.py +++ b/tests/pytest/tag_lite/tinyint.py @@ -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') diff --git a/tests/pytest/tag_lite/unsignedBigint.py b/tests/pytest/tag_lite/unsignedBigint.py index 032dacd366..6a33812f88 100644 --- a/tests/pytest/tag_lite/unsignedBigint.py +++ b/tests/pytest/tag_lite/unsignedBigint.py @@ -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') diff --git a/tests/pytest/tag_lite/unsignedInt.py b/tests/pytest/tag_lite/unsignedInt.py index 6efe12edf1..ce6c546a3f 100644 --- a/tests/pytest/tag_lite/unsignedInt.py +++ b/tests/pytest/tag_lite/unsignedInt.py @@ -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') diff --git a/tests/pytest/tag_lite/unsignedSmallint.py b/tests/pytest/tag_lite/unsignedSmallint.py index 59cb33dc18..21c390d9dc 100644 --- a/tests/pytest/tag_lite/unsignedSmallint.py +++ b/tests/pytest/tag_lite/unsignedSmallint.py @@ -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') diff --git a/tests/pytest/tag_lite/unsignedTinyint.py b/tests/pytest/tag_lite/unsignedTinyint.py index 1250b08d1b..7ce3a83984 100644 --- a/tests/pytest/tag_lite/unsignedTinyint.py +++ b/tests/pytest/tag_lite/unsignedTinyint.py @@ -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') From 3e560be2c0f132f653b4c905db375cffac5b4424 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Wed, 9 Jun 2021 15:47:00 +0800 Subject: [PATCH 2/9] fix bug --- src/client/src/tscSub.c | 10 ++++++++-- src/tsdb/src/tsdbRead.c | 3 +++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index 327ccd0294..a6d09b5d8d 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -264,7 +264,7 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { SSqlCmd* pCmd = &pSql->cmd; - pSub->lastSyncTime = taosGetTimestampMs(); + TSDB_QUERY_CLEAR_TYPE(tscGetQueryInfoDetail(pCmd, 0)->type, TSDB_QUERY_TYPE_MULTITABLE_QUERY); STableMetaInfo *pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) { @@ -275,6 +275,8 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { taosArrayClear(pSub->progress); taosArrayPush(pSub->progress, &target); } + + pSub->lastSyncTime = taosGetTimestampMs(); return 1; } @@ -304,7 +306,11 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { } taosArrayDestroy(tables); - TSDB_QUERY_SET_TYPE(tscGetQueryInfoDetail(pCmd, 0)->type, TSDB_QUERY_TYPE_MULTITABLE_QUERY); + if (pTableMetaInfo->pVgroupTables && taosArrayGetSize(pTableMetaInfo->pVgroupTables) > 0) { + TSDB_QUERY_SET_TYPE(tscGetQueryInfoDetail(pCmd, 0)->type, TSDB_QUERY_TYPE_MULTITABLE_QUERY); + } + + pSub->lastSyncTime = taosGetTimestampMs(); return 1; } diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 1cc0780b9d..4d36c740b4 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -3319,6 +3319,9 @@ int32_t tsdbGetTableGroupFromIdList(STsdbRepo* tsdb, SArray* pTableIdList, STabl if (pTable->type == TSDB_SUPER_TABLE) { tsdbError("direct query on super tale is not allowed, table uid:%"PRIu64", tid:%d", id->uid, id->tid); terrno = TSDB_CODE_QRY_INVALID_MSG; + tsdbUnlockRepoMeta(tsdb); + taosArrayDestroy(group); + return terrno; } tsdbRefTable(pTable); From dc47e229d8738cc9c46d7edb685d60e61ff53255 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Wed, 9 Jun 2021 16:00:37 +0800 Subject: [PATCH 3/9] add pointer protection --- src/util/src/ttokenizer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 3448e8e2ba..b02ba96f07 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -275,6 +275,10 @@ static int32_t tKeywordCode(const char* z, int n) { } } + if (keywordHashTable == NULL) { + return TK_ILLEGAL; + } + SKeyword** pKey = (SKeyword**)taosHashGet(keywordHashTable, key, n); return (pKey != NULL)? (*pKey)->type:TK_ID; } From b4f6e6f9412ce6846139f6b29594760ea5a59ff1 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Wed, 9 Jun 2021 18:46:15 +0800 Subject: [PATCH 4/9] [TD-4630]: add exception handling for restful insert --- tests/pytest/insert/restfulInsert.py | 40 +++++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/tests/pytest/insert/restfulInsert.py b/tests/pytest/insert/restfulInsert.py index 6489fd31ff..43dc4bd403 100644 --- a/tests/pytest/insert/restfulInsert.py +++ b/tests/pytest/insert/restfulInsert.py @@ -40,12 +40,13 @@ class RestfulInsert: if tableID + i >= self.numOfTables : break name = 'beijing' if (tableID + i) % 2 == 0 else 'shanghai' data = "create table if not exists %s.%s%d using %s.meters tags(%d, '%s')" % (self.dbname, self.tableNamePerfix, tableID + i, self.dbname, tableID + i, name) - response = requests.post(self.url, data, headers = self.header) - if response.status_code != 200: - print(response.content) + try: + response = requests.post(self.url, data, headers = self.header) + if response.status_code != 200: + print(response.content) + except Exception as e: + print(e) - - def insertData(self, threadID): print("thread %d started" % threadID) tablesPerThread = int (self.numOfTables / self.numOfThreads) @@ -90,10 +91,16 @@ class RestfulInsert: if len(data) > 1024*1024 : print ('batch size is larger than 1M') exit(-1) - response = requests.post(self.url, data, headers = self.header) - if response.status_code != 200: - print(response.content) - + try: + startTime = time.time() + response = requests.post(self.url, data, headers = self.header) + endTime = time.time() + if response.status_code != 200: + print(response.content) + else: + print("inserted %d records, %d seconds" % (bloop, endTime - startTime)) + except Exception as e: + print(e) def insertUnlimitedData(self, threadID): print("thread %d started" % threadID) @@ -119,10 +126,17 @@ class RestfulInsert: else: random.shuffle(values) for k in range(len(values)): - data += values[k] - response = requests.post(self.url, data, headers = self.header) - if response.status_code != 200: - print(response.content) + data += values[k] + try: + startTime = time.time() + response = requests.post(self.url, data, headers = self.header) + endTime = time.time() + if response.status_code != 200: + print(response.content) + else: + print("inserted %d records, %d seconds" % (self.batchSize, endTime - startTime)) + except Exception as e: + print(e) def run(self): data = "create database if not exists %s" % self.dbname From 490caa967ba71b7af0a67675adadeceeb2cfeaa5 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Wed, 9 Jun 2021 20:31:11 +0800 Subject: [PATCH 5/9] [TD-4599]: fix false dnode offline --- src/balance/src/bnMain.c | 8 ++++---- src/balance/src/bnThread.c | 12 ++++++------ src/mnode/inc/mnodeDef.h | 3 +-- src/mnode/inc/mnodeDnode.h | 2 +- src/mnode/src/mnodeDnode.c | 12 ++++++------ 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/balance/src/bnMain.c b/src/balance/src/bnMain.c index 3055f77e81..25f316cb5e 100644 --- a/src/balance/src/bnMain.c +++ b/src/balance/src/bnMain.c @@ -405,7 +405,7 @@ void bnReset() { if (pDnode == NULL) break; // while master change, should reset dnode to offline - mInfo("dnode:%d set access:%d to 0", pDnode->dnodeId, pDnode->lastAccess); + mInfo("dnode:%d set access:%" PRId64 " to 0", pDnode->dnodeId, pDnode->lastAccess); pDnode->lastAccess = 0; if (pDnode->status != TAOS_DN_STATUS_DROPPING) { pDnode->status = TAOS_DN_STATUS_OFFLINE; @@ -499,7 +499,7 @@ static bool bnMontiorDropping() { if (dnodeIsMasterEp(pDnode->dnodeEp)) continue; if (mnodeGetDnodesNum() <= 1) continue; - mLInfo("dnode:%d, set to removing state for it offline:%d seconds", pDnode->dnodeId, + mLInfo("dnode:%d, set to removing state for it offline:%" PRId64 " seconds", pDnode->dnodeId, tsAccessSquence - pDnode->lastAccess); pDnode->status = TAOS_DN_STATUS_DROPPING; @@ -574,8 +574,8 @@ void bnCheckStatus() { if (pDnode->status != TAOS_DN_STATUS_DROPPING && pDnode->status != TAOS_DN_STATUS_OFFLINE) { pDnode->status = TAOS_DN_STATUS_OFFLINE; pDnode->offlineReason = TAOS_DN_OFF_STATUS_MSG_TIMEOUT; - mInfo("dnode:%d, set to offline state, access seq:%d last seq:%d laststat:%d", pDnode->dnodeId, tsAccessSquence, - pDnode->lastAccess, pDnode->status); + mInfo("dnode:%d, set to offline state, access seq:%" PRId64 " last seq:%" PRId64 " laststat:%d", pDnode->dnodeId, + tsAccessSquence, pDnode->lastAccess, pDnode->status); bnSetVgroupOffline(pDnode); bnStartTimer(3000); } diff --git a/src/balance/src/bnThread.c b/src/balance/src/bnThread.c index d07591ecd5..f39b82f2c6 100644 --- a/src/balance/src/bnThread.c +++ b/src/balance/src/bnThread.c @@ -101,13 +101,13 @@ static void bnProcessTimer(void *handle, void *tmrId) { if (!sdbIsMaster()) return; if (tsBnThread.stop) return; - tsBnThread.timer = NULL; - tsAccessSquence++; - - bnStartTimer(-1); - bnCheckStatus(); - if (handle == NULL) { + tsBnThread.timer = NULL; + ++tsAccessSquence; + + bnStartTimer(-1); + bnCheckStatus(); + if (tsAccessSquence % tsBalanceInterval == 0) { mDebug("balance function is scheduled by timer"); bnPostSignal(); diff --git a/src/mnode/inc/mnodeDef.h b/src/mnode/inc/mnodeDef.h index e052f34a33..c1f2ea7fd7 100644 --- a/src/mnode/inc/mnodeDef.h +++ b/src/mnode/inc/mnodeDef.h @@ -48,9 +48,8 @@ typedef struct SDnodeObj { int32_t dnodeId; int32_t openVnodes; int64_t createdTime; - int32_t resever0; // from dnode status msg, config information + int64_t lastAccess; int32_t customScore; // config by user - uint32_t lastAccess; uint16_t numOfCores; // from dnode status msg uint16_t dnodePort; char dnodeFqdn[TSDB_FQDN_LEN]; diff --git a/src/mnode/inc/mnodeDnode.h b/src/mnode/inc/mnodeDnode.h index fa1995254e..d357cd65b8 100644 --- a/src/mnode/inc/mnodeDnode.h +++ b/src/mnode/inc/mnodeDnode.h @@ -77,7 +77,7 @@ void * mnodeGetDnodeByEp(char *ep); void mnodeUpdateDnode(SDnodeObj *pDnode); int32_t mnodeDropDnode(SDnodeObj *pDnode, void *pMsg); -extern int32_t tsAccessSquence; +extern int64_t tsAccessSquence; #ifdef __cplusplus } diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index 8a5d24c474..fb775d92d8 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -39,8 +39,8 @@ #include "mnodePeer.h" #include "mnodeCluster.h" -int32_t tsAccessSquence = 0; -int64_t tsDnodeRid = -1; +int64_t tsAccessSquence = 0; +int64_t tsDnodeRid = -1; static void * tsDnodeSdb = NULL; static int32_t tsDnodeUpdateSize = 0; extern void * tsMnodeSdb; @@ -567,7 +567,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { mnodeGetClusterId()); return TSDB_CODE_MND_INVALID_CLUSTER_ID; } else { - mTrace("dnode:%d, status received, access times %d openVnodes:%d:%d", pDnode->dnodeId, pDnode->lastAccess, + mTrace("dnode:%d, status received, access times %" PRId64 " openVnodes:%d:%d", pDnode->dnodeId, pDnode->lastAccess, htons(pStatus->openVnodes), pDnode->openVnodes); } } @@ -629,9 +629,9 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { bnNotify(); } - if (!tsEnableBalance) { - int32_t numOfMnodes = mnodeGetMnodesNum(); - if (numOfMnodes < tsNumOfMnodes) bnNotify(); + int32_t numOfMnodes = mnodeGetMnodesNum(); + if (numOfMnodes < tsNumOfMnodes && numOfMnodes < mnodeGetOnlineDnodesNum()) { + bnNotify(); } if (openVnodes != pDnode->openVnodes) { From 935d41b1f77caff075e2c14d0055e1eb872315f4 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 10 Jun 2021 09:53:51 +0800 Subject: [PATCH 6/9] bnThread: dummy commit to make CI happy --- src/balance/src/bnThread.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/balance/src/bnThread.c b/src/balance/src/bnThread.c index f39b82f2c6..b5043c19bb 100644 --- a/src/balance/src/bnThread.c +++ b/src/balance/src/bnThread.c @@ -122,8 +122,7 @@ static void bnProcessTimer(void *handle, void *tmrId) { void bnStartTimer(int32_t mseconds) { if (tsBnThread.stop) return; - bool updateSoon = (mseconds != -1); - if (updateSoon) { + if (mseconds != -1) { mTrace("balance function will be called after %d ms", mseconds); taosTmrReset(bnProcessTimer, mseconds, (void *)(int64_t)mseconds, tsMnodeTmr, &tsBnThread.timer); } else { @@ -132,5 +131,5 @@ void bnStartTimer(int32_t mseconds) { } void bnNotify() { - bnStartTimer(500); + bnStartTimer(10); } From b93129fea59d17de9099dcfb817f749194eb9aa0 Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 10 Jun 2021 19:06:30 +0800 Subject: [PATCH 7/9] [TD4610] --- tests/pytest/fulltest.sh | 13 +++- tests/pytest/insert/special_character_show.py | 59 +++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/pytest/insert/special_character_show.py diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index 7434d32b9d..ce80c68b25 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -20,6 +20,7 @@ python3 ./test.py -f insert/randomNullCommit.py python3 insert/retentionpolicy.py python3 ./test.py -f insert/alterTableAndInsert.py python3 ./test.py -f insert/insertIntoTwoTables.py +python3 ./test.py -f insert/special_character_show.py python3 ./test.py -f insert/before_1970.py python3 bug2265.py python3 ./test.py -f insert/bug3654.py @@ -38,6 +39,8 @@ python3 ./test.py -f table/boundary.py python3 ./test.py -f table/create.py python3 ./test.py -f table/del_stable.py +#stable +python3 ./test.py -f stable/insert.py # tag python3 ./test.py -f tag_lite/filter.py @@ -227,7 +230,7 @@ python3 ./test.py -f query/queryFilterTswithDateUnit.py python3 ./test.py -f query/queryTscomputWithNow.py python3 ./test.py -f query/computeErrorinWhere.py python3 ./test.py -f query/queryTsisNull.py - +python3 ./test.py -f query/subqueryFilter.py #stream @@ -254,6 +257,8 @@ python3 ./test.py -f client/client.py python3 ./test.py -f client/version.py python3 ./test.py -f client/alterDatabase.py python3 ./test.py -f client/noConnectionErrorTest.py +python3 test.py -f client/change_time_1_1.py +python3 test.py -f client/change_time_1_2.py # Misc python3 testCompress.py @@ -281,6 +286,7 @@ python3 ./test.py -f topic/topicQuery.py python3 ./test.py -f update/merge_commit_data-0.py # wal python3 ./test.py -f wal/addOldWalTest.py +python3 ./test.py -f wal/sdbComp.py # function python3 ./test.py -f functions/all_null_value.py @@ -312,6 +318,7 @@ python3 ./test.py -f query/last_row_cache.py python3 ./test.py -f account/account_create.py python3 ./test.py -f alter/alter_table.py python3 ./test.py -f query/queryGroupbySort.py +python3 ./test.py -f functions/function_stateWindow.py python3 ./test.py -f insert/unsignedInt.py python3 ./test.py -f insert/unsignedBigint.py @@ -333,5 +340,9 @@ python3 ./test.py -f tag_lite/alter_tag.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py python3 ./test.py -f tag_lite/drop_auto_create.py +python3 test.py -f insert/insert_before_use_db.py +python3 test.py -f alter/alter_keep.py +python3 test.py -f alter/alter_cacheLastRow.py python3 test.py -f alter/alter_keep_exception.py +python3 ./test.py -f query/querySession.py #======================p4-end=============== diff --git a/tests/pytest/insert/special_character_show.py b/tests/pytest/insert/special_character_show.py new file mode 100644 index 0000000000..3b2df5c873 --- /dev/null +++ b/tests/pytest/insert/special_character_show.py @@ -0,0 +1,59 @@ +################################################################### +# Copyright (c) 2016 by TAOS Technologies, Inc. +# All rights reserved. +# +# This file is proprietary and confidential to TAOS Technologies. +# No part of this file may be reproduced, stored, transmitted, +# disclosed or used in any form or by any means other than as +# expressly provided by the written permission from Jianhui Tao +# +################################################################### + +# -*- coding: utf-8 -*- + +import sys +from util.log import * +from util.cases import * +from util.sql import * + + +class TDTestCase: + def init(self, conn, logSql): + tdLog.debug("start to execute %s" % __file__) + tdSql.init(conn.cursor(), logSql) + + def run(self): + tdSql.prepare() + # test case for https://jira.taosdata.com:18080/browse/TD-4584 + + #1 + tdLog.info('=============== step1,create stable') + tdLog.info('create table stb1 (ts timestamp, value double) tags (bin binary(128))') + tdSql.execute('create table stb1 (ts timestamp, value double) tags (bin binary(128))') + + tdLog.info('=============== step2,create table增加了转义字符') + tdLog.info('create table tb1 using stb1 tags("abc\\"def")') + #增加了转义字符\ + tdSql.execute('create table tb1 using stb1 tags("abc\\"def")') + + tdLog.info('=============== step3,insert data') + tdLog.info('insert into tb1 values(now,1.0)') + tdSql.execute('insert into tb1 values(now,1.0)') + + tdLog.info('=============== step4,select table') + tdLog.info('select * from stb1 ') + tdSql.query('select * from stb1 ') + + tdLog.info('=============== step5,check data') + tdSql.checkData(0,2,'abc"def') + + + + + def stop(self): + tdSql.close() + tdLog.success("%s successfully executed" % __file__) + + +tdCases.addWindows(__file__, TDTestCase()) +tdCases.addLinux(__file__, TDTestCase()) From 6b428ce341c0d0baeee1cb8fb902ff142feece1c Mon Sep 17 00:00:00 2001 From: happyguoxy Date: Thu, 10 Jun 2021 19:26:23 +0800 Subject: [PATCH 8/9] [TD-i4610] --- tests/pytest/fulltest.sh | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index ce80c68b25..188cb6ad07 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -20,8 +20,8 @@ python3 ./test.py -f insert/randomNullCommit.py python3 insert/retentionpolicy.py python3 ./test.py -f insert/alterTableAndInsert.py python3 ./test.py -f insert/insertIntoTwoTables.py -python3 ./test.py -f insert/special_character_show.py python3 ./test.py -f insert/before_1970.py +python3 ./test.py -f insert/special_character_show.py python3 bug2265.py python3 ./test.py -f insert/bug3654.py python3 ./test.py -f insert/insertDynamicColBeforeVal.py @@ -39,8 +39,6 @@ python3 ./test.py -f table/boundary.py python3 ./test.py -f table/create.py python3 ./test.py -f table/del_stable.py -#stable -python3 ./test.py -f stable/insert.py # tag python3 ./test.py -f tag_lite/filter.py @@ -230,7 +228,7 @@ python3 ./test.py -f query/queryFilterTswithDateUnit.py python3 ./test.py -f query/queryTscomputWithNow.py python3 ./test.py -f query/computeErrorinWhere.py python3 ./test.py -f query/queryTsisNull.py -python3 ./test.py -f query/subqueryFilter.py + #stream @@ -257,8 +255,6 @@ python3 ./test.py -f client/client.py python3 ./test.py -f client/version.py python3 ./test.py -f client/alterDatabase.py python3 ./test.py -f client/noConnectionErrorTest.py -python3 test.py -f client/change_time_1_1.py -python3 test.py -f client/change_time_1_2.py # Misc python3 testCompress.py @@ -286,7 +282,6 @@ python3 ./test.py -f topic/topicQuery.py python3 ./test.py -f update/merge_commit_data-0.py # wal python3 ./test.py -f wal/addOldWalTest.py -python3 ./test.py -f wal/sdbComp.py # function python3 ./test.py -f functions/all_null_value.py @@ -318,7 +313,6 @@ python3 ./test.py -f query/last_row_cache.py python3 ./test.py -f account/account_create.py python3 ./test.py -f alter/alter_table.py python3 ./test.py -f query/queryGroupbySort.py -python3 ./test.py -f functions/function_stateWindow.py python3 ./test.py -f insert/unsignedInt.py python3 ./test.py -f insert/unsignedBigint.py @@ -340,9 +334,5 @@ python3 ./test.py -f tag_lite/alter_tag.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestInsertWithJson.py python3 test.py -f tools/taosdemoAllTest/taosdemoTestQueryWithJson.py python3 ./test.py -f tag_lite/drop_auto_create.py -python3 test.py -f insert/insert_before_use_db.py -python3 test.py -f alter/alter_keep.py -python3 test.py -f alter/alter_cacheLastRow.py python3 test.py -f alter/alter_keep_exception.py -python3 ./test.py -f query/querySession.py #======================p4-end=============== From b0fb8f9dc6af18759eb23888e2ebdb8c5b88e1c1 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 10 Jun 2021 13:32:42 +0800 Subject: [PATCH 9/9] balance: remove unused pVgroup->lbTime checking --- src/balance/src/bnMain.c | 4 ---- src/balance/src/bnThread.c | 12 ++++++------ src/mnode/src/mnodeDnode.c | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/balance/src/bnMain.c b/src/balance/src/bnMain.c index 25f316cb5e..67741b1473 100644 --- a/src/balance/src/bnMain.c +++ b/src/balance/src/bnMain.c @@ -220,10 +220,6 @@ int32_t bnAllocVnodes(SVgObj *pVgroup) { } static bool bnCheckVgroupReady(SVgObj *pVgroup, SVnodeGid *pRmVnode) { - if (pVgroup->lbTime + 5 * tsStatusInterval > tsAccessSquence) { - return false; - } - int32_t rmVnodeVer = 0; for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) { SVnodeGid *pVnode = pVgroup->vnodeGid + i; diff --git a/src/balance/src/bnThread.c b/src/balance/src/bnThread.c index b5043c19bb..44cb24effa 100644 --- a/src/balance/src/bnThread.c +++ b/src/balance/src/bnThread.c @@ -101,12 +101,12 @@ static void bnProcessTimer(void *handle, void *tmrId) { if (!sdbIsMaster()) return; if (tsBnThread.stop) return; - if (handle == NULL) { - tsBnThread.timer = NULL; - ++tsAccessSquence; + tsBnThread.timer = NULL; + bnStartTimer(-1); + bnCheckStatus(); - bnStartTimer(-1); - bnCheckStatus(); + if (handle == NULL) { + ++tsAccessSquence; if (tsAccessSquence % tsBalanceInterval == 0) { mDebug("balance function is scheduled by timer"); @@ -131,5 +131,5 @@ void bnStartTimer(int32_t mseconds) { } void bnNotify() { - bnStartTimer(10); + bnStartTimer(500); } diff --git a/src/mnode/src/mnodeDnode.c b/src/mnode/src/mnodeDnode.c index fb775d92d8..70a63517ca 100644 --- a/src/mnode/src/mnodeDnode.c +++ b/src/mnode/src/mnodeDnode.c @@ -630,7 +630,7 @@ static int32_t mnodeProcessDnodeStatusMsg(SMnodeMsg *pMsg) { } int32_t numOfMnodes = mnodeGetMnodesNum(); - if (numOfMnodes < tsNumOfMnodes && numOfMnodes < mnodeGetOnlineDnodesNum()) { + if (numOfMnodes < tsNumOfMnodes && numOfMnodes < mnodeGetOnlineDnodesNum() && !pDnode->isMgmt) { bnNotify(); }