diff --git a/tests/system-test/2-query/timetruncate.py b/tests/system-test/2-query/timetruncate.py index 4c4ebb09df96b23b453d4048de6a1f5ceeb15c25..a48851b251235b6c6acd84b1b81d82c2cd54c7dd 100644 --- a/tests/system-test/2-query/timetruncate.py +++ b/tests/system-test/2-query/timetruncate.py @@ -95,7 +95,123 @@ class TDTestCase: # tdSql.checkData(9,0,"2018-09-17 09:00:00.009000000") - + tdSql.query("select timetruncate(1,1d) from stb") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1u) from stb") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1a) from stb") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1m) from stb") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1h) from stb") + tdSql.checkRows(10) + tdSql.query("select timetruncate(ts,1d) from stb") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 08:00:00.000") + tdSql.query("select timetruncate(ts,1h) from stb") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1m) from stb") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1s) from stb") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1a) from stb") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.checkData(1,0,"2018-09-17 09:00:00.001") + tdSql.checkData(2,0,"2018-09-17 09:00:00.002") + tdSql.checkData(3,0,"2018-09-17 09:00:00.003") + tdSql.checkData(4,0,"2018-09-17 09:00:00.004") + tdSql.checkData(5,0,"2018-09-17 09:00:00.005") + tdSql.checkData(6,0,"2018-09-17 09:00:00.006") + tdSql.checkData(7,0,"2018-09-17 09:00:00.007") + tdSql.checkData(8,0,"2018-09-17 09:00:00.008") + tdSql.checkData(9,0,"2018-09-17 09:00:00.009") + # tdSql.query("select timetruncate(ts,1u) from stb") + # tdSql.checkRows(10) + # tdSql.checkData(0,0,"2018-09-17 09:00:00.000000") + # tdSql.checkData(1,0,"2018-09-17 09:00:00.001000") + # tdSql.checkData(2,0,"2018-09-17 09:00:00.002000") + # tdSql.checkData(3,0,"2018-09-17 09:00:00.003000") + # tdSql.checkData(4,0,"2018-09-17 09:00:00.004000") + # tdSql.checkData(5,0,"2018-09-17 09:00:00.005000") + # tdSql.checkData(6,0,"2018-09-17 09:00:00.006000") + # tdSql.checkData(7,0,"2018-09-17 09:00:00.007000") + # tdSql.checkData(8,0,"2018-09-17 09:00:00.008000") + # tdSql.checkData(9,0,"2018-09-17 09:00:00.009000") + # tdSql.query("select timetruncate(ts,1b) from stb") + # tdSql.checkRows(10) + # tdSql.checkData(0,0,"2018-09-17 09:00:00.000000000") + # tdSql.checkData(1,0,"2018-09-17 09:00:00.001000000") + # tdSql.checkData(2,0,"2018-09-17 09:00:00.002000000") + # tdSql.checkData(3,0,"2018-09-17 09:00:00.003000000") + # tdSql.checkData(4,0,"2018-09-17 09:00:00.004000000") + # tdSql.checkData(5,0,"2018-09-17 09:00:00.005000000") + # tdSql.checkData(6,0,"2018-09-17 09:00:00.006000000") + # tdSql.checkData(7,0,"2018-09-17 09:00:00.007000000") + # tdSql.checkData(8,0,"2018-09-17 09:00:00.008000000") + # tdSql.checkData(9,0,"2018-09-17 09:00:00.009000000") + + tdSql.query("select timetruncate(1,1d) from stb_1") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1u) from stb_1") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1a) from stb_1") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1m) from stb_1") + tdSql.checkRows(10) + tdSql.query("select timetruncate(1,1h) from stb_1") + tdSql.checkRows(10) + tdSql.query("select timetruncate(ts,1d) from stb_1") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 08:00:00.000") + tdSql.query("select timetruncate(ts,1h) from stb_1") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1m) from stb_1") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1s) from stb_1") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.query("select timetruncate(ts,1a) from stb_1") + tdSql.checkRows(10) + tdSql.checkData(0,0,"2018-09-17 09:00:00.000") + tdSql.checkData(1,0,"2018-09-17 09:00:00.001") + tdSql.checkData(2,0,"2018-09-17 09:00:00.002") + tdSql.checkData(3,0,"2018-09-17 09:00:00.003") + tdSql.checkData(4,0,"2018-09-17 09:00:00.004") + tdSql.checkData(5,0,"2018-09-17 09:00:00.005") + tdSql.checkData(6,0,"2018-09-17 09:00:00.006") + tdSql.checkData(7,0,"2018-09-17 09:00:00.007") + tdSql.checkData(8,0,"2018-09-17 09:00:00.008") + tdSql.checkData(9,0,"2018-09-17 09:00:00.009") + # tdSql.query("select timetruncate(ts,1u) from stb_1") + # tdSql.checkRows(10) + # tdSql.checkData(0,0,"2018-09-17 09:00:00.000000") + # tdSql.checkData(1,0,"2018-09-17 09:00:00.001000") + # tdSql.checkData(2,0,"2018-09-17 09:00:00.002000") + # tdSql.checkData(3,0,"2018-09-17 09:00:00.003000") + # tdSql.checkData(4,0,"2018-09-17 09:00:00.004000") + # tdSql.checkData(5,0,"2018-09-17 09:00:00.005000") + # tdSql.checkData(6,0,"2018-09-17 09:00:00.006000") + # tdSql.checkData(7,0,"2018-09-17 09:00:00.007000") + # tdSql.checkData(8,0,"2018-09-17 09:00:00.008000") + # tdSql.checkData(9,0,"2018-09-17 09:00:00.009000") + # tdSql.query("select timetruncate(ts,1b) from stb_1") + # tdSql.checkRows(10) + # tdSql.checkData(0,0,"2018-09-17 09:00:00.000000000") + # tdSql.checkData(1,0,"2018-09-17 09:00:00.001000000") + # tdSql.checkData(2,0,"2018-09-17 09:00:00.002000000") + # tdSql.checkData(3,0,"2018-09-17 09:00:00.003000000") + # tdSql.checkData(4,0,"2018-09-17 09:00:00.004000000") + # tdSql.checkData(5,0,"2018-09-17 09:00:00.005000000") + # tdSql.checkData(6,0,"2018-09-17 09:00:00.006000000") + # tdSql.checkData(7,0,"2018-09-17 09:00:00.007000000") + # tdSql.checkData(8,0,"2018-09-17 09:00:00.008000000") + # tdSql.checkData(9,0,"2018-09-17 09:00:00.009000000") def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__) diff --git a/tests/system-test/fulltest.sh b/tests/system-test/fulltest.sh index 0b7a71bbe4dc7ccbecb0235802690cf7c8ab4e34..026dba6490ee25c7ba58156e97fd0d484cf0b822 100755 --- a/tests/system-test/fulltest.sh +++ b/tests/system-test/fulltest.sh @@ -14,7 +14,10 @@ python3 ./test.py -f 2-query/varchar.py #python3 ./test.py -f 2-query/timezone.py python3 ./test.py -f 2-query/Now.py python3 ./test.py -f 2-query/Today.py - +python3 ./test.py -f 2-query/max.py +python3 ./test.py -f 2-query/min.py +python3 ./test.py -f 2-query/count.py +# python3 ./test.py -f 2-query/Timediff.py #python3 ./test.py -f 2-query/cast.py