tdLog.info("asin value check pass , it work as expected ,sql is \"%s\" "%pow_query)
deftest_errors(self):
deftest_errors(self,dbname="db"):
error_sql_lists=[
"select asin from t1",
# "select asin(-+--+c1 ) from t1",
# "select +-asin(c1) from t1",
# "select ++-asin(c1) from t1",
# "select ++--asin(c1) from t1",
# "select - -asin(c1)*0 from t1",
# "select asin(tbname+1) from t1 ",
"select asin(123--123)==1 from t1",
"select asin(c1) as 'd1' from t1",
"select asin(c1 ,c2) from t1",
"select asin(c1 ,NULL ) from t1",
"select asin(,) from t1;",
"select asin(asin(c1) ab from t1)",
"select asin(c1 ) as int from t1",
"select asin from stb1",
# "select asin(-+--+c1) from stb1",
# "select +-asin(c1) from stb1",
# "select ++-asin(c1) from stb1",
# "select ++--asin(c1) from stb1",
# "select - -asin(c1)*0 from stb1",
# "select asin(tbname+1) from stb1 ",
"select asin(123--123)==1 from stb1",
"select asin(c1) as 'd1' from stb1",
"select asin(c1 ,c2 ) from stb1",
"select asin(c1 ,NULL) from stb1",
"select asin(,) from stb1;",
"select asin(asin(c1) ab from stb1)",
"select asin(c1) as int from stb1"
f"select asin from {dbname}.t1",
# f"select asin(-+--+c1 ) from {dbname}.t1",
# f"select +-asin(c1) from {dbname}.t1",
# f"select ++-asin(c1) from {dbname}.t1",
# f"select ++--asin(c1) from {dbname}.t1",
# f"select - -asin(c1)*0 from {dbname}.t1",
# f"select asin(tbname+1) from {dbname}.t1 ",
f"select asin(123--123)==1 from {dbname}.t1",
f"select asin(c1) as 'd1' from {dbname}.t1",
f"select asin(c1 ,c2) from {dbname}.t1",
f"select asin(c1 ,NULL ) from {dbname}.t1",
f"select asin(,) from {dbname}.t1;",
f"select asin(asin(c1) ab from {dbname}.t1)",
f"select asin(c1 ) as int from {dbname}.t1",
f"select asin from {dbname}.stb1",
# f"select asin(-+--+c1) from {dbname}.stb1",
# f"select +-asin(c1) from {dbname}.stb1",
# f"select ++-asin(c1) from {dbname}.stb1",
# f"select ++--asin(c1) from {dbname}.stb1",
# f"select - -asin(c1)*0 from {dbname}.stb1",
# f"select asin(tbname+1) from {dbname}.stb1 ",
f"select asin(123--123)==1 from {dbname}.stb1",
f"select asin(c1) as 'd1' from {dbname}.stb1",
f"select asin(c1 ,c2 ) from {dbname}.stb1",
f"select asin(c1 ,NULL) from {dbname}.stb1",
f"select asin(,) from {dbname}.stb1;",
f"select asin(asin(c1) ab from {dbname}.stb1)",
f"select asin(c1) as int from {dbname}.stb1"
]
forerror_sqlinerror_sql_lists:
tdSql.error(error_sql)
defsupport_types(self):
defsupport_types(self,dbname="db"):
type_error_sql_lists=[
"select asin(ts) from t1",
"select asin(c7) from t1",
"select asin(c8) from t1",
"select asin(c9) from t1",
"select asin(ts) from ct1",
"select asin(c7) from ct1",
"select asin(c8) from ct1",
"select asin(c9) from ct1",
"select asin(ts) from ct3",
"select asin(c7) from ct3",
"select asin(c8) from ct3",
"select asin(c9) from ct3",
"select asin(ts) from ct4",
"select asin(c7) from ct4",
"select asin(c8) from ct4",
"select asin(c9) from ct4",
"select asin(ts) from stb1",
"select asin(c7) from stb1",
"select asin(c8) from stb1",
"select asin(c9) from stb1",
"select asin(ts) from stbbb1",
"select asin(c7) from stbbb1",
"select asin(ts) from tbname",
"select asin(c9) from tbname"
f"select asin(ts) from {dbname}.t1",
f"select asin(c7) from {dbname}.t1",
f"select asin(c8) from {dbname}.t1",
f"select asin(c9) from {dbname}.t1",
f"select asin(ts) from {dbname}.ct1",
f"select asin(c7) from {dbname}.ct1",
f"select asin(c8) from {dbname}.ct1",
f"select asin(c9) from {dbname}.ct1",
f"select asin(ts) from {dbname}.ct3",
f"select asin(c7) from {dbname}.ct3",
f"select asin(c8) from {dbname}.ct3",
f"select asin(c9) from {dbname}.ct3",
f"select asin(ts) from {dbname}.ct4",
f"select asin(c7) from {dbname}.ct4",
f"select asin(c8) from {dbname}.ct4",
f"select asin(c9) from {dbname}.ct4",
f"select asin(ts) from {dbname}.stb1",
f"select asin(c7) from {dbname}.stb1",
f"select asin(c8) from {dbname}.stb1",
f"select asin(c9) from {dbname}.stb1",
f"select asin(ts) from {dbname}.stbbb1",
f"select asin(c7) from {dbname}.stbbb1",
f"select asin(ts) from {dbname}.tbname",
f"select asin(c9) from {dbname}.tbname"
]
...
...
@@ -172,103 +171,103 @@ class TDTestCase:
type_sql_lists=[
"select asin(c1) from t1",
"select asin(c2) from t1",
"select asin(c3) from t1",
"select asin(c4) from t1",
"select asin(c5) from t1",
"select asin(c6) from t1",
"select asin(c1) from ct1",
"select asin(c2) from ct1",
"select asin(c3) from ct1",
"select asin(c4) from ct1",
"select asin(c5) from ct1",
"select asin(c6) from ct1",
"select asin(c1) from ct3",
"select asin(c2) from ct3",
"select asin(c3) from ct3",
"select asin(c4) from ct3",
"select asin(c5) from ct3",
"select asin(c6) from ct3",
"select asin(c1) from stb1",
"select asin(c2) from stb1",
"select asin(c3) from stb1",
"select asin(c4) from stb1",
"select asin(c5) from stb1",
"select asin(c6) from stb1",
"select asin(c6) as alisb from stb1",
"select asin(c6) alisb from stb1",
f"select asin(c1) from {dbname}.t1",
f"select asin(c2) from {dbname}.t1",
f"select asin(c3) from {dbname}.t1",
f"select asin(c4) from {dbname}.t1",
f"select asin(c5) from {dbname}.t1",
f"select asin(c6) from {dbname}.t1",
f"select asin(c1) from {dbname}.ct1",
f"select asin(c2) from {dbname}.ct1",
f"select asin(c3) from {dbname}.ct1",
f"select asin(c4) from {dbname}.ct1",
f"select asin(c5) from {dbname}.ct1",
f"select asin(c6) from {dbname}.ct1",
f"select asin(c1) from {dbname}.ct3",
f"select asin(c2) from {dbname}.ct3",
f"select asin(c3) from {dbname}.ct3",
f"select asin(c4) from {dbname}.ct3",
f"select asin(c5) from {dbname}.ct3",
f"select asin(c6) from {dbname}.ct3",
f"select asin(c1) from {dbname}.stb1",
f"select asin(c2) from {dbname}.stb1",
f"select asin(c3) from {dbname}.stb1",
f"select asin(c4) from {dbname}.stb1",
f"select asin(c5) from {dbname}.stb1",
f"select asin(c6) from {dbname}.stb1",
f"select asin(c6) as alisb from {dbname}.stb1",
f"select asin(c6) alisb from {dbname}.stb1",
]
fortype_sqlintype_sql_lists:
tdSql.query(type_sql)
defbasic_asin_function(self):
defbasic_asin_function(self,dbname="db"):
# basic query
tdSql.query("select c1 from ct3")
tdSql.query(f"select c1 from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select c1 from t1")
tdSql.query(f"select c1 from {dbname}.t1")
tdSql.checkRows(12)
tdSql.query("select c1 from stb1")
tdSql.query(f"select c1 from {dbname}.stb1")
tdSql.checkRows(25)
# used for empty table , ct3 is empty
tdSql.query("select asin(c1) from ct3")
tdSql.query(f"select asin(c1) from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select asin(c2) from ct3")
tdSql.query(f"select asin(c2) from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select asin(c3) from ct3")
tdSql.query(f"select asin(c3) from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select asin(c4) from ct3")
tdSql.query(f"select asin(c4) from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select asin(c5) from ct3")
tdSql.query(f"select asin(c5) from {dbname}.ct3")
tdSql.checkRows(0)
tdSql.query("select asin(c6) from ct3")
tdSql.query(f"select asin(c6) from {dbname}.ct3")
tdSql.checkRows(0)
# # used for regular table
tdSql.query("select asin(c1) from t1")
tdSql.query(f"select asin(c1) from {dbname}.t1")
tdSql.checkData(0,0,None)
tdSql.checkData(1,0,1.570796327)
tdSql.checkData(3,0,None)
tdSql.checkData(5,0,None)
tdSql.query("select c1, c2, c3 , c4, c5 from t1")
tdSql.query(f"select c1, c2, c3 , c4, c5 from {dbname}.t1")
tdSql.checkData(1,4,1.11000)
tdSql.checkData(3,3,33)
tdSql.checkData(5,4,None)
tdSql.query("select ts,c1, c2, c3 , c4, c5 from t1")
tdSql.query(f"select ts,c1, c2, c3 , c4, c5 from {dbname}.t1")
tdSql.checkData(1,5,1.11000)
tdSql.checkData(3,4,33)
tdSql.checkData(5,5,None)
self.check_result_auto_asin("select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from t1","select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from t1")
self.check_result_auto_asin(f"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from {dbname}.t1",f"select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from {dbname}.t1")
# used for sub table
tdSql.query("select c2 ,asin(c2) from ct1")
tdSql.query(f"select c2 ,asin(c2) from {dbname}.ct1")
tdSql.checkData(0,1,None)
tdSql.checkData(1,1,None)
tdSql.checkData(3,1,None)
tdSql.checkData(4,1,0.000000000)
tdSql.checkData(4,1,0)
tdSql.query("select c1, c5 ,asin(c5) from ct4")
tdSql.query(f"select c1, c5 ,asin(c5) from {dbname}.ct4")
tdSql.checkData(0,2,None)
tdSql.checkData(1,2,None)
tdSql.checkData(2,2,None)
tdSql.checkData(3,2,None)
tdSql.checkData(5,2,None)
self.check_result_auto_asin("select c1, c2, c3 , c4, c5 from ct1","select asin(c1), asin(c2) ,asin(c3), asin(c4), asin(c5) from ct1")
self.check_result_auto_asin(f"select c1, c2, c3 , c4, c5 from {dbname}.ct1",f"select asin(c1), asin(c2) ,asin(c3), asin(c4), asin(c5) from {dbname}.ct1")
# nest query for asin functions
tdSql.query("select c4 , asin(c4) ,asin(asin(c4)) , asin(asin(asin(c4))) from ct1;")
tdSql.query(f"select c4 , asin(c4) ,asin(asin(c4)) , asin(asin(asin(c4))) from {dbname}.ct1;")
tdSql.checkData(0,0,88)
tdSql.checkData(0,1,None)
tdSql.checkData(0,2,None)
...
...
@@ -286,22 +285,22 @@ class TDTestCase:
# used for stable table
tdSql.query("select asin(c1) from stb1")
tdSql.query(f"select asin(c1) from {dbname}.stb1")
tdSql.checkRows(25)
# used for not exists table
tdSql.error("select asin(c1) from stbbb1")
tdSql.error("select asin(c1) from tbname")
tdSql.error("select asin(c1) from ct5")
tdSql.error(f"select asin(c1) from {dbname}.stbbb1")
tdSql.error(f"select asin(c1) from {dbname}.tbname")
tdSql.error(f"select asin(c1) from {dbname}.ct5")
# mix with common col
tdSql.query("select c1, asin(c1) from ct1")
tdSql.query("select c2, asin(c2) from ct4")
tdSql.query(f"select c1, asin(c1) from {dbname}.ct1")
tdSql.query(f"select c2, asin(c2) from {dbname}.ct4")
# mix with common functions
tdSql.query("select c1, asin(c1),asin(c1), asin(asin(c1)) from ct4 ")
tdSql.query(f"select c1, asin(c1),asin(c1), asin(asin(c1)) from {dbname}.ct4 ")
tdSql.checkData(0,0,None)
tdSql.checkData(0,1,None)
tdSql.checkData(0,2,None)
...
...
@@ -312,24 +311,24 @@ class TDTestCase:
tdSql.checkData(3,2,None)
tdSql.checkData(3,3,None)
tdSql.query("select c1, asin(c1),c5, floor(c5) from stb1 ")
tdSql.query(f"select c1, asin(c1),c5, floor(c5) from {dbname}.stb1 ")
# # mix with agg functions , not support
tdSql.error("select c1, asin(c1),c5, count(c5) from stb1 ")
tdSql.error("select c1, asin(c1),c5, count(c5) from ct1 ")
tdSql.error("select asin(c1), count(c5) from stb1 ")
tdSql.error("select asin(c1), count(c5) from ct1 ")
tdSql.error("select c1, count(c5) from ct1 ")
tdSql.error("select c1, count(c5) from stb1 ")
tdSql.error(f"select c1, asin(c1),c5, count(c5) from {dbname}.stb1 ")
tdSql.error(f"select c1, asin(c1),c5, count(c5) from {dbname}.ct1 ")
tdSql.error(f"select asin(c1), count(c5) from {dbname}.stb1 ")
tdSql.error(f"select asin(c1), count(c5) from {dbname}.ct1 ")
tdSql.error(f"select c1, count(c5) from {dbname}.ct1 ")
tdSql.error(f"select c1, count(c5) from {dbname}.stb1 ")
# agg functions mix with agg functions
tdSql.query("select max(c5), count(c5) from stb1")
tdSql.query("select max(c5), count(c5) from ct1")
tdSql.query(f"select max(c5), count(c5) from {dbname}.stb1")
tdSql.query(f"select max(c5), count(c5) from {dbname}.ct1")
# # bug fix for compute
tdSql.query("select c1, asin(c1) -0 ,asin(c1-4)-0 from ct4 ")
tdSql.query(f"select c1, asin(c1) -0 ,asin(c1-4)-0 from {dbname}.ct4 ")
tdSql.checkData(0,0,None)
tdSql.checkData(0,1,None)
tdSql.checkData(0,2,None)
...
...
@@ -337,7 +336,7 @@ class TDTestCase:
tdSql.checkData(1,1,None)
tdSql.checkData(1,2,None)
tdSql.query(" select c1, asin(c1) -0 ,asin(c1-0.1)-0.1 from ct4")
tdSql.query(f" select c1, asin(c1) -0 ,asin(c1-0.1)-0.1 from {dbname}.ct4")
tdSql.checkData(0,0,None)
tdSql.checkData(0,1,None)
tdSql.checkData(0,2,None)
...
...
@@ -345,35 +344,35 @@ class TDTestCase:
tdSql.checkData(1,1,None)
tdSql.checkData(1,2,None)
tdSql.query("select c1, asin(c1), c2, asin(c2), c3, asin(c3) from ct1")
tdSql.query(f"select c1, asin(c1), c2, asin(c2), c3, asin(c3) from {dbname}.ct1")
deftest_big_number(self):
deftest_big_number(self,dbname="db"):
tdSql.query("select c1, asin(100000000) from ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(100000000) from {dbname}.ct1")# bigint to double data overflow
tdSql.checkData(4,1,None)
tdSql.query("select c1, asin(10000000000000) from ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(10000000000000) from {dbname}.ct1")# bigint to double data overflow
tdSql.checkData(4,1,None)
tdSql.query("select c1, asin(10000000000000000000000000) from ct1")# bigint to double data overflow
tdSql.query("select c1, asin(10000000000000000000000000.0) from ct1")# 10000000000000000000000000.0 is a double value
tdSql.query(f"select c1, asin(10000000000000000000000000) from {dbname}.ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(10000000000000000000000000.0) from {dbname}.ct1")# 10000000000000000000000000.0 is a double value
tdSql.checkData(1,1,None)
tdSql.query("select c1, asin(10000000000000000000000000000000000) from ct1")# bigint to double data overflow
tdSql.query("select c1, asin(10000000000000000000000000000000000.0) from ct1")# 10000000000000000000000000.0 is a double value
tdSql.query(f"select c1, asin(10000000000000000000000000000000000) from {dbname}.ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(10000000000000000000000000000000000.0) from {dbname}.ct1")# 10000000000000000000000000.0 is a double value
tdSql.checkData(4,1,None)
tdSql.query("select c1, asin(10000000000000000000000000000000000000000) from ct1")# bigint to double data overflow
tdSql.query("select c1, asin(10000000000000000000000000000000000000000.0) from ct1")# 10000000000000000000000000.0 is a double value
tdSql.query(f"select c1, asin(10000000000000000000000000000000000000000) from {dbname}.ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(10000000000000000000000000000000000000000.0) from {dbname}.ct1")# 10000000000000000000000000.0 is a double value
tdSql.checkData(4,1,None)
tdSql.query("select c1, asin(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from ct1")# bigint to double data overflow
tdSql.query(f"select c1, asin(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from {dbname}.ct1")# bigint to double data overflow
defabs_func_filter(self):
tdSql.execute("use db")
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from ct4 where c1>5 ")
defabs_func_filter(self,dbname="db"):
tdSql.execute(f"use {dbname}")
tdSql.query(f"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from {dbname}.ct4 where c1>5 ")
tdSql.checkRows(3)
tdSql.checkData(0,0,8)
tdSql.checkData(0,1,8.000000000)
...
...
@@ -381,7 +380,7 @@ class TDTestCase:
tdSql.checkData(0,3,7.900000000)
tdSql.checkData(0,4,None)
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from ct4 where c1=5 ")
tdSql.query(f"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from {dbname}.ct4 where c1=5 ")
tdSql.checkRows(1)
tdSql.checkData(0,0,5)
tdSql.checkData(0,1,5.000000000)
...
...
@@ -389,7 +388,7 @@ class TDTestCase:
tdSql.checkData(0,3,4.900000000)
tdSql.checkData(0,4,None)
tdSql.query("select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from ct4 where c1<asin(c1) limit 1 ")
tdSql.query(f"select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(asin(c1)-0.5) from {dbname}.ct4 where c1<asin(c1) limit 1 ")
self.check_result_auto_asin("select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ","select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from sub1_bound")
self.check_result_auto_asin(f"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from {dbname}.sub1_bound ",f"select asin(abs(c1)), asin(abs(c2)) ,asin(abs(c3)), asin(abs(c4)), asin(abs(c5)) from {dbname}.sub1_bound")
self.check_result_auto_asin("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select asin(c1), asin(c2) ,asin(c3), asin(c3), asin(c2) ,asin(c1) from sub1_bound")
self.check_result_auto_asin(f"select c1, c2, c3 , c3, c2 ,c1 from {dbname}.sub1_bound ",f"select asin(c1), asin(c2) ,asin(c3), asin(c3), asin(c2) ,asin(c1) from {dbname}.sub1_bound")
self.check_result_auto_asin("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select asin(abs(c1)) from sub1_bound")
self.check_result_auto_asin(f"select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from {dbname}.sub1_bound",f"select asin(abs(c1)) from {dbname}.sub1_bound")
tdSql.execute(f'create table {dbname}.tb1 using {dbname}.st tags (1)')
tdSql.execute(f'create table {dbname}.tb2 using {dbname}.st tags (2)')
tdSql.execute(f'create table {dbname}.tb3 using {dbname}.st tags (3)')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-40s, {PI/2}, {PI/2})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-30s, {PI}, {PI})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-20s, {PI*1.5}, {PI*1.5})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-10s, {PI*2}, {PI*2})')
tdSql.execute(f'insert into {dbname}.tb1 values (now(), {PI*2.5}, {PI*2.5})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-40s, {PI/2}, {PI/2})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-30s, {PI}, {PI})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-20s, {PI*1.5}, {PI*1.5})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-10s, {PI*2}, {PI*2})')
tdSql.execute(f'insert into {dbname}.tb2 values (now(), {PI*2.5}, {PI*2.5})')
foriinrange(100):
tdSql.execute('insert into tb3 values (now()+{}s, {}, {})'.format(i,PI*(5+i)/2,PI*(5+i)/2))
tdSql.execute(f'insert into {dbname}.tb3 values (now()+{i}s, {PI*(5+i)/2}, {PI*(5+i)/2})')
self.check_result_auto_asin("select num1,num2 from tb3;","select asin(num1),asin(num2) from tb3")
self.check_result_auto_asin(f"select num1,num2 from {dbname}.tb3;",f"select asin(num1),asin(num2) from {dbname}.tb3")
defsupport_super_table_test(self):
tdSql.execute(" use db ")
self.check_result_auto_asin(" select c5 from stb1 order by ts ","select asin(c5) from stb1 order by ts")
self.check_result_auto_asin(" select c5 from stb1 order by tbname ","select asin(c5) from stb1 order by tbname")
self.check_result_auto_asin(" select c5 from stb1 where c1 > 0 order by tbname ","select asin(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(" select c5 from stb1 where c1 > 0 order by tbname ","select asin(c5) from stb1 where c1 > 0 order by tbname")
defsupport_super_table_test(self,dbname="db"):
tdSql.execute(f" use {dbname} ")
self.check_result_auto_asin(f" select c5 from {dbname}.stb1 order by ts ",f"select asin(c5) from {dbname}.stb1 order by ts")
self.check_result_auto_asin(f" select c5 from {dbname}.stb1 order by tbname ",f"select asin(c5) from {dbname}.stb1 order by tbname")
self.check_result_auto_asin(f" select c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select asin(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(f" select c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select asin(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(" select t1,c5 from stb1 order by ts ","select asin(t1), asin(c5) from stb1 order by ts")
self.check_result_auto_asin(" select t1,c5 from stb1 order by tbname ","select asin(t1) ,asin(c5) from stb1 order by tbname")
self.check_result_auto_asin(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select asin(t1) ,asin(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select asin(t1) , asin(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(f" select t1,c5 from {dbname}.stb1 order by ts ",f"select asin(t1), asin(c5) from {dbname}.stb1 order by ts")
self.check_result_auto_asin(f" select t1,c5 from {dbname}.stb1 order by tbname ",f"select asin(t1) ,asin(c5) from {dbname}.stb1 order by tbname")
self.check_result_auto_asin(f" select t1,c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select asin(t1) ,asin(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_asin(f" select t1,c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select asin(t1) , asin(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
tdSql.query("select c1, atan(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from ct1")# bigint to double data overflow
tdSql.query(f"select c1, atan(10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from {dbname}.ct1")# bigint to double data overflow
defabs_func_filter(self):
tdSql.execute("use db")
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from ct4 where c1>5 ")
defabs_func_filter(self,dbname="db"):
tdSql.execute(f"use {dbname}")
tdSql.query(f"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from {dbname}.ct4 where c1>5 ")
tdSql.checkRows(3)
tdSql.checkData(0,0,8)
tdSql.checkData(0,1,8.000000000)
...
...
@@ -378,7 +378,7 @@ class TDTestCase:
tdSql.checkData(0,3,7.900000000)
tdSql.checkData(0,4,1.000000000)
tdSql.query("select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from ct4 where c1=5 ")
tdSql.query(f"select c1, abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from {dbname}.ct4 where c1=5 ")
tdSql.checkRows(1)
tdSql.checkData(0,0,5)
tdSql.checkData(0,1,5.000000000)
...
...
@@ -386,7 +386,7 @@ class TDTestCase:
tdSql.checkData(0,3,4.900000000)
tdSql.checkData(0,4,1.000000000)
tdSql.query("select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from ct4 where c1=atan(c1) limit 1 ")
tdSql.query(f"select c1,c2 , abs(c1) -0 ,ceil(c1-0.1)-0 ,floor(c1+0.1)-0.1 ,ceil(atan(c1)-0.5) from {dbname}.ct4 where c1=atan(c1) limit 1 ")
self.check_result_auto_atan("select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from sub1_bound ","select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from sub1_bound")
self.check_result_auto_atan(f"select abs(c1), abs(c2), abs(c3) , abs(c4), abs(c5) from {dbname}.sub1_bound ",f"select atan(abs(c1)), atan(abs(c2)) ,atan(abs(c3)), atan(abs(c4)), atan(abs(c5)) from {dbname}.sub1_bound")
self.check_result_auto_atan("select c1, c2, c3 , c3, c2 ,c1 from sub1_bound ","select atan(c1), atan(c2) ,atan(c3), atan(c3), atan(c2) ,atan(c1) from sub1_bound")
self.check_result_auto_atan(f"select c1, c2, c3 , c3, c2 ,c1 from {dbname}.sub1_bound ",f"select atan(c1), atan(c2) ,atan(c3), atan(c3), atan(c2) ,atan(c1) from {dbname}.sub1_bound")
self.check_result_auto_atan("select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from sub1_bound","select atan(abs(c1)) from sub1_bound")
self.check_result_auto_atan(f"select abs(abs(abs(abs(abs(abs(abs(abs(abs(c1))))))))) nest_col_func from {dbname}.sub1_bound",f"select atan(abs(c1)) from {dbname}.sub1_bound")
tdSql.execute(f'create table {dbname}.tb1 using {dbname}.st tags (1)')
tdSql.execute(f'create table {dbname}.tb2 using {dbname}.st tags (2)')
tdSql.execute(f'create table {dbname}.tb3 using {dbname}.st tags (3)')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-40s, {PI/2}, {PI/2})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-30s, {PI}, {PI})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-20s, {PI*1.5}, {PI*1.5})')
tdSql.execute(f'insert into {dbname}.tb1 values (now()-10s, {PI*2}, {PI*2})')
tdSql.execute(f'insert into {dbname}.tb1 values (now(), {PI*2.5}, {PI*2.5})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-40s, {PI/2}, {PI/2})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-30s, {PI}, {PI})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-20s, {PI*1.5}, {PI*1.5})')
tdSql.execute(f'insert into {dbname}.tb2 values (now()-10s, {PI*2}, {PI*2})')
tdSql.execute(f'insert into {dbname}.tb2 values (now(), {PI*2.5}, {PI*2.5})')
foriinrange(100):
tdSql.execute('insert into tb3 values (now()+{}s, {}, {})'.format(i,PI*(5+i)/2,PI*(5+i)/2))
self.check_result_auto_atan("select num1,num2 from tb3;","select atan(num1),atan(num2) from tb3")
tdSql.execute(f'insert into {dbname}.tb3 values (now()+{i}s, {PI*(5+i)/2}, {PI*(5+i)/2})')
self.check_result_auto_atan(f"select num1,num2 from {dbname}.tb3;",f"select atan(num1),atan(num2) from {dbname}.tb3")
defsupport_super_table_test(self):
tdSql.execute(" use db ")
self.check_result_auto_atan(" select c5 from stb1 order by ts ","select atan(c5) from stb1 order by ts")
self.check_result_auto_atan(" select c5 from stb1 order by tbname ","select atan(c5) from stb1 order by tbname")
self.check_result_auto_atan(" select c5 from stb1 where c1 > 0 order by tbname ","select atan(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(" select c5 from stb1 where c1 > 0 order by tbname ","select atan(c5) from stb1 where c1 > 0 order by tbname")
defsupport_super_table_test(self,dbname="db"):
tdSql.execute(f" use {dbname} ")
self.check_result_auto_atan(f" select c5 from {dbname}.stb1 order by ts ",f"select atan(c5) from {dbname}.stb1 order by ts")
self.check_result_auto_atan(f" select c5 from {dbname}.stb1 order by tbname ",f"select atan(c5) from {dbname}.stb1 order by tbname")
self.check_result_auto_atan(f" select c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select atan(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(f" select c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select atan(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(" select t1,c5 from stb1 order by ts ","select atan(t1), atan(c5) from stb1 order by ts")
self.check_result_auto_atan(" select t1,c5 from stb1 order by tbname ","select atan(t1) ,atan(c5) from stb1 order by tbname")
self.check_result_auto_atan(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select atan(t1) ,atan(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(" select t1,c5 from stb1 where c1 > 0 order by tbname ","select atan(t1) , atan(c5) from stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(f" select t1,c5 from {dbname}.stb1 order by ts ",f"select atan(t1), atan(c5) from {dbname}.stb1 order by ts")
self.check_result_auto_atan(f" select t1,c5 from {dbname}.stb1 order by tbname ",f"select atan(t1) ,atan(c5) from {dbname}.stb1 order by tbname")
self.check_result_auto_atan(f" select t1,c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select atan(t1) ,atan(c5) from {dbname}.stb1 where c1 > 0 order by tbname")
self.check_result_auto_atan(f" select t1,c5 from {dbname}.stb1 where c1 > 0 order by tbname ",f"select atan(t1) , atan(c5) from {dbname}.stb1 where c1 > 0 order by tbname")