diff --git a/tests/system-test/2-query/elapsed.py b/tests/system-test/2-query/elapsed.py index 333c60286e68ea20daf465d4c8670a569377a852..8c478174528f3b1f5c5659d818fe2d03ab00c175 100644 --- a/tests/system-test/2-query/elapsed.py +++ b/tests/system-test/2-query/elapsed.py @@ -86,13 +86,20 @@ class TDTestCase: ''' return - def prepare_data(self): + def prepare_db(self,dbname,vgroupVar): + + tdLog.info (" ====================================== prepare db ==================================================") + tdSql.execute('drop database if exists testdb ;') + tdSql.execute('create database %s keep 36500 vgroups %d ;'%(dbname,vgroupVar)) + + + def prepare_data(self,dbname): tdLog.info (" ====================================== prepare data ==================================================") - tdSql.execute('drop database if exists testdb ;') - tdSql.execute('create database testdb keep 36500;') - tdSql.execute('use testdb;') + # tdSql.execute('drop database if exists testdb ;') + # tdSql.execute('create database testdb keep 36500;') + tdSql.execute('use %s;'%dbname) tdSql.execute('create stable stable_1(ts timestamp ,tscol timestamp, q_int int , q_bigint bigint , q_smallint smallint , q_tinyint tinyint, q_float float ,\ q_double double , bin_chars binary(20)) tags(loc nchar(20) ,ind int,tstag timestamp);') @@ -1317,6 +1324,13 @@ class TDTestCase: # # bug fix tdSql.error("select elapsed(tsc ,1s) from (select tscol tsc from regular_table_1) ;") + #TD-19911 + tdSql.error("select elapsed(ts,1s,123) from (select ts,tbname from regular_table_1 order by ts asc );") + tdSql.error("select elapsed() from (select ts,tbname from regular_table_1 order by ts asc );") + tdSql.error("select elapsed(tscol,1s) from (select ts,tbname from regular_table_1 order by ts asc );") + tdSql.error("select elapsed(ts,1n) from (select ts,tbname from regular_table_1 order by ts asc );") + tdSql.error("select elapsed(ts,1y) from (select ts,tbname from regular_table_1 order by ts asc );") + # case TD-12276 tdSql.query("select elapsed(ts,1s) from (select ts,tbname from regular_table_1 order by ts asc );") tdSql.checkData(0,0,90.000000000) @@ -1525,7 +1539,6 @@ class TDTestCase: def query_precision(self): def generate_data(precision="ms"): - tdSql.execute("create database if not exists db_%s precision '%s';" %(precision, precision)) tdSql.execute("use db_%s;" %precision) tdSql.execute("create stable db_%s.st (ts timestamp , id int) tags(ind int);"%precision) @@ -1579,7 +1592,9 @@ class TDTestCase: def run(self): tdSql.prepare() - self.prepare_data() + dbNameTest="testdbV1" + self.prepare_db(dbNameTest,1) + self.prepare_data(dbNameTest) self.abnormal_common_test() self.abnormal_use_test() self.query_filter() @@ -1596,6 +1611,25 @@ class TDTestCase: self.continuous_query() self.query_precision() + dbNameTest="testdbV2" + self.prepare_db(dbNameTest,2) + self.prepare_data(dbNameTest) + self.abnormal_common_test() + self.abnormal_use_test() + self.query_filter() + # self.query_interval() + self.query_mix_common() + self.query_mix_Aggregate() + self.query_mix_select() + self.query_mix_compute() + self.query_mix_arithmetic() + # self.query_with_join() + # self.query_with_union() + self.query_nest() + self.query_session_windows() + self.continuous_query() + # self.query_precision() + def stop(self): tdSql.close() tdLog.success("%s successfully executed" % __file__)