diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c index 42330aa18e48eb60389ef3056c96a2aab386a6ca..43a8884e57f85dba5bae3263630b38e8c3dcb43a 100644 --- a/src/client/src/tscSub.c +++ b/src/client/src/tscSub.c @@ -265,7 +265,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, 0); if (UTIL_TABLE_IS_NORMAL_TABLE(pTableMetaInfo)) { @@ -276,6 +276,8 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { taosArrayClear(pSub->progress); taosArrayPush(pSub->progress, &target); } + + pSub->lastSyncTime = taosGetTimestampMs(); return 1; } @@ -305,7 +307,11 @@ static int tscUpdateSubscription(STscObj* pObj, SSub* pSub) { } taosArrayDestroy(tables); - TSDB_QUERY_SET_TYPE(tscGetQueryInfo(pCmd)->type, TSDB_QUERY_TYPE_MULTITABLE_QUERY); + if (pTableMetaInfo->pVgroupTables && taosArrayGetSize(pTableMetaInfo->pVgroupTables) > 0) { + TSDB_QUERY_SET_TYPE(tscGetQueryInfo(pCmd)->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 cd86f13d4b4263a9ef321d32cef1a5b6531803f0..972c3c4e10c163c4c5b66d3390200b97f207e0a0 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -3572,6 +3572,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); diff --git a/src/util/src/ttokenizer.c b/src/util/src/ttokenizer.c index 3ab2aca67fac36dff1280d6fa35849f3222fb203..62389f191fe5d48933f040d4dca136204a1b9f51 100644 --- a/src/util/src/ttokenizer.c +++ b/src/util/src/ttokenizer.c @@ -265,6 +265,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; } diff --git a/tests/pytest/tag_lite/3.py b/tests/pytest/tag_lite/3.py index 373db1c70fcc67eec7f4abae4e6264cad7fddf64..bbdf0868fae6d465525dbe7191172b4145b53f80 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 aae930ecdf67c04040c47115daad3e2b662915e9..df81dd81000c0698ea4ab1fb661d3b7f55059fbb 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 b3608bebee649b38b0d1315cc1cb97a43d5365e6..28c8fc125a9c9f27230e63494e9d7f57c5505154 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 b789e41794449e4ec97d03423bfcd03703f7604b..5cf43f10475181202eaa901d0a7ef1d1d23e86e0 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 f83961aaad401f337a1dc4f0d305391f22006b9a..733d30983d07ab9e2c30076b76084edb354e289f 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 4cbae63bec1ec6a885f015a69bb4192e93cc9629..3825c6637f9357e00bc8491be1d8c2960dde2109 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 9c789eafd655d76362d5bc4729fd4e5da8de2156..2a76238f595ce5b079f0d36453197875d214145c 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 6f2afd262509571187b83cba26d6773dbfde0464..11ce9eb7f8126e9d0adf4bedeaf055e3f4ab2c1b 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 bfc496e8e4013ab5fb1bf929d7aeb3d37238b343..934d91c9084e7631feb6c34c596b23a7e0314cb7 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 f7bfc7acef276609c8606185102b5463807d577a..1e857192ede0602c8aa5e279da12ea488559ec07 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 b1f29f592e70c582cde9b9eff114ff78843c6fc3..c9d3a5af9e88a0c1faccfabd17245dcaf54b179f 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 7b93cb0ac91d49299aedfa63e5dcc8571415cdce..589df89ab9e000dae8c953bb64aaeda51ca0c86c 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 d5a69173893c4e5c8341b6235c5dd8465f913111..1297d083a0d9aa30a21c3235c89a31236175a119 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 7760814f664b4b04d42b67bba3f86ce069928b70..6ce9a9a431f644e1a6c9e7c9dece955dc9f40bfd 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 31c94130ab30e83c68ab017e44cf313202e6b966..341acfd5ae0784c0d0d46a0757490fdfe8bca599 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 c060e3f82b6b5f2b6d32fd50e5ea8181f655ad9b..93fde22ca92219852426ac18c550231130d23384 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 089dd46569578c1ca33d73639cb36a0bba03e0f0..fc4af4ee9648ef6aca5badeada5420063f76050b 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 032dacd366437c378b0b8c9b553d6495966cd563..6a33812f8839bf8c329c35b9c700bf5479d14a64 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 6efe12edf110f70d9c2c0187429a0696372bae49..ce6c546a3f8f2ccb3b60fbf6846ca8258d689c2c 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 59cb33dc18eb74b27e9a916e921e10cbabf1b4eb..21c390d9dca81fc6eb6ef87435acb1bf6d12c406 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 1250b08d1b8dd4d3cb5f61af424576146ab70967..7ce3a8398444efae63ccdc93062c00c81c644da0 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')