diff --git a/tests/pytest/functions/data.tar.gz b/tests/pytest/functions/data.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..9b0fd32993cb2654e9b6c2a9546903436da43f27 Binary files /dev/null and b/tests/pytest/functions/data.tar.gz differ diff --git a/tests/pytest/functions/function_diff.py b/tests/pytest/functions/function_diff.py index 5995b821d1a42e75d7b80e0d564e4281da9b3979..9742518886b93ec644e994f211583a37e61cf4e3 100644 --- a/tests/pytest/functions/function_diff.py +++ b/tests/pytest/functions/function_diff.py @@ -16,6 +16,7 @@ import taos from util.log import * from util.cases import * from util.sql import * +from util.dnodes import * import numpy as np @@ -156,7 +157,25 @@ class TDTestCase: tdSql.error("select diff(col) from st group by dev") tdSql.error("select diff(col) from st group by col") - + + # TS-1612 + os.system("tar -zxf %s/functions/data.tar.gz" % os.getcwd()) + tdSql.execute("create database radb") + tdSql.execute("use radb") + tdSql.execute("CREATE TABLE `vehicle_automode` (`time` TIMESTAMP,`auto_ctl_odom` INT) TAGS (`mac_address` BINARY(30))") + tdSql.execute("CREATE TABLE `va_00545a230327` USING `vehicle_automode` TAGS ('00545a230327')") + tdSql.execute("insert into va_00545a230327 file 'data/va_00545a230327.csv' ") + tdSql.query("select * from vehicle_automode") + rows = tdSql.queryRows + tdSql.query("select diff(auto_ctl_odom,1) as aco from radb.vehicle_automode GROUP BY tbname") + tdSql.checkRows(rows - 1) + os.system("rm -rf data") + + tdDnodes.stop(1) + tdDnodes.start(1) + tdSql.query("select diff(auto_ctl_odom,1) as aco from radb.vehicle_automode GROUP BY tbname") + tdSql.checkRows(rows - 1) + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__)