't1.q_tinyint >= -127 and t1.q_tinyint <= 127 and t2.q_tinyint >= -127 and t2.q_tinyint <= 127',
't1.q_float >= -100000 and t1.q_float <= 100000 and t2.q_float >= -100000 and t2.q_float <= 100000',
't1.q_double >= -1000000000 and t1.q_double <= 1000000000 and t2.q_double >= -1000000000 and t2.q_double <= 1000000000',
't1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' ',
't1.q_binary like \'binary%\' and t2.q_binary like \'binary%\' ',
't1.q_nchar like \'nchar%\' and t2.q_nchar like \'nchar%\' ',
't1.q_bool in (0 , 1) and t2.q_bool in (0 , 1)','t1.q_bool in ( true , false) and t2.q_bool in ( true , false)',
't1.q_bigint between -9223372036854775807 and 9223372036854775807 and t2.q_bigint between -9223372036854775807 and 9223372036854775807',
't1.q_int between -2147483647 and 2147483647 and t2.q_int between -2147483647 and 2147483647',
't1.q_smallint between -32767 and 32767 and t2.q_smallint between -32767 and 32767',
't1.q_tinyint between -127 and 127 and t2.q_tinyint between -127 and 127 ','t1.q_float between -100000 and 100000 and t2.q_float between -100000 and 100000',
't1.q_double between -1000000000 and 1000000000 and t2.q_double between -1000000000 and 1000000000']
#TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1']
#'t1.q_bool = true and t1.q_bool = false and t2.q_bool = true and t2.q_bool = false' , 't1.q_bool = 0 and t1.q_bool = 1 and t2.q_bool = 0 and t2.q_bool = 1' ,
q_u_or_where=['t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' ',
't1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' ','t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false',
't1.q_bool in (0 , 1) or t2.q_bool in (0 , 1)','t1.q_bool in ( true , false) or t2.q_bool in ( true , false)','t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1',
't1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807',
...
...
@@ -225,7 +236,6 @@ class TDTestCase:
't1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767',
't1.q_tinyint between -127 and 127 or t2.q_tinyint between -127 and 127 ','t1.q_float between -100000 and 100000 or t2.q_float between -100000 and 100000',
't1.q_double between -1000000000 and 1000000000 or t2.q_double between -1000000000 and 1000000000']
#TD-6201 ,'t1.q_bool between 0 and 1 or t2.q_bool between 0 and 1']
# tag column where
t_where=['ts < now +1s','t_bigint >= -9223372036854775807 and t_bigint <= 9223372036854775807','t_int <= 2147483647 and t_int >= -2147483647',
...
...
@@ -245,17 +255,28 @@ class TDTestCase:
't1.t_double >= -1000000000 and t1.t_double <= 1000000000 and t2.t_double >= -1000000000 and t2.t_double <= 1000000000',
't1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' ',
't1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' ','t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false',
't1.t_bool in (0 , 1) and t2.t_bool in (0 , 1)','t1.t_bool in ( true , false) and t2.t_bool in ( true , false)','t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1',
't1.t_bigint between -9223372036854775807 and 9223372036854775807 and t2.t_bigint between -9223372036854775807 and 9223372036854775807',
't1.t_int between -2147483647 and 2147483647 and t2.t_int between -2147483647 and 2147483647',
't1.t_smallint between -32767 and 32767 and t2.t_smallint between -32767 and 32767',
't1.t_tinyint between -127 and 127 and t2.t_tinyint between -127 and 127 ','t1.t_float between -100000 and 100000 and t2.t_float between -100000 and 100000',
't1.t_double between -1000000000 and 1000000000 and t2.t_double between -1000000000 and 1000000000']
#TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1']
t_u_or_where=['t1.t_binary like \'binary%\' or t1.t_binary = \'0\' or t2.t_binary like \'binary%\' or t2.t_binary = \'0\' ',
't1.t_nchar like \'nchar%\' or t1.t_nchar = \'0\' or t2.t_nchar like \'nchar%\' or t2.t_nchar = \'0\' ','t1.t_bool = true or t1.t_bool = false or t2.t_bool = true or t2.t_bool = false',
't1.t_bool in (0 , 1) or t2.t_bool in (0 , 1)','t1.t_bool in ( true , false) or t2.t_bool in ( true , false)','t1.t_bool = 0 or t1.t_bool = 1 or t2.t_bool = 0 or t2.t_bool = 1',
't1.t_bigint between -9223372036854775807 and 9223372036854775807 or t2.t_bigint between -9223372036854775807 and 9223372036854775807',
't1.t_int between -2147483647 and 2147483647 or t2.t_int between -2147483647 and 2147483647',
't1.t_smallint between -32767 and 32767 or t2.t_smallint between -32767 and 32767',
't1.t_tinyint between -127 and 127 or t2.t_tinyint between -127 and 127 ','t1.t_float between -100000 and 100000 or t2.t_float between -100000 and 100000',
't1.t_double between -1000000000 and 1000000000 or t2.t_double between -1000000000 and 1000000000']
#TD-6201,'t1.t_bool between 0 and 1 or t2.q_bool between 0 and 1']
# regular and tag column where
qt_where=q_where+t_where
qt_u_where=q_u_where+t_u_where
# now,qt_u_or_where is not support
qt_u_or_where=q_u_or_where+t_u_or_where
# tag column where for test super join | this is support , 't1.t_bool = t2.t_bool ' ???
sql+=" as calc15_3 from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+="%s "%random.choice(group_where)
sql+="%s "%random.choice(having_support)
sql+="%s "%random.choice(orders_desc_where)
sql+=") "
sql+="order by calc15_1 "
sql+="%s "%random.choice(limit_u_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.error(sql)
tdSql.query("select 15-5 from table_0;")
foriinrange(self.fornum):
sql="select * from ( select "
...
...
@@ -1161,6 +1345,20 @@ class TDTestCase:
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 16-2.2 from table_0;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_0 "%random.choice(calc_calculate_all_j)
sql+=", %s as calc16_1 "%random.choice(calc_aggregate_all_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+=") "
sql+="order by calc16_0 "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.error(sql)
dcDB=self.dropandcreateDB(random.randint(1,3))
tdSql.query("select 16-3 from table_0;")
...
...
@@ -1188,6 +1386,18 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.checkRows(1)
tdSql.query("select 16-4.2 from table_0;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_regular_j)
sql+=" from regular_table_1 t1, regular_table_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(q_u_or_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.error(sql)
tdSql.query("select 16-5 from table_0;")
foriinrange(self.fornum):
...
...
@@ -1233,6 +1443,18 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.error(sql)
tdSql.query("select 16-8 from table_0;")
foriinrange(self.fornum):
sql="select * from ( select "
sql+="%s as calc16_1 "%random.choice(calc_calculate_groupbytbname_j)
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+="limit 2 ) "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
tdSql.error(sql)
#17 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or interval_sliding group by having order by limit offset )interval_sliding
# TD-6088
dcDB=self.dropandcreateDB(random.randint(1,2))
...
...
@@ -1275,6 +1497,24 @@ class TDTestCase:
tdLog.info(len(sql))
tdSql.query(sql)
tdSql.query("select 17-2.2 from table_0;")
foriinrange(self.fornum):
#this is having_support , but tag-select cannot mix with last_row,other select can