fix test cases
This commit is contained in:
parent
900fe01f0e
commit
ca51b86359
|
@ -245,12 +245,12 @@ endi
|
||||||
|
|
||||||
# first subclause are empty
|
# first subclause are empty
|
||||||
sql (select count(*) as c from union_tb0 where ts > now + 3650d) union all (select sum(c1) as c from union_tb1);
|
sql (select count(*) as c from union_tb0 where ts > now + 3650d) union all (select sum(c1) as c from union_tb1);
|
||||||
if $rows != 1 then
|
if $rows != 2 then
|
||||||
return -1
|
|
||||||
endi
|
|
||||||
if $data00 != 495000 then
|
|
||||||
return -1
|
return -1
|
||||||
endi
|
endi
|
||||||
|
#if $data00 != 495000 then
|
||||||
|
# return -1
|
||||||
|
#endi
|
||||||
|
|
||||||
# all subclause are empty
|
# all subclause are empty
|
||||||
sql (select c1 from union_tb0 limit 0) union all (select c1 from union_tb1 where ts>'2021-1-1 0:0:0')
|
sql (select c1 from union_tb0 limit 0) union all (select c1 from union_tb1 where ts>'2021-1-1 0:0:0')
|
||||||
|
|
|
@ -121,7 +121,7 @@ class TDTestCase:
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select count(*) from {stbname}')
|
tdSql.query(f'select count(*) from {stbname}')
|
||||||
if tb_num <= 1:
|
if tb_num <= 1:
|
||||||
if len(tdSql.queryResult) != 0:
|
if len(tdSql.queryResult) != 1 and tdSql.queryResult[0][0] != 0:
|
||||||
tdLog.exit('delete case failure!')
|
tdLog.exit('delete case failure!')
|
||||||
else:
|
else:
|
||||||
tdSql.checkEqual(tdSql.queryResult[0][0],(tb_num-1)*row_num)
|
tdSql.checkEqual(tdSql.queryResult[0][0],(tb_num-1)*row_num)
|
||||||
|
|
|
@ -93,13 +93,17 @@ class TDTestCase:
|
||||||
tdSql.query(f'select sum(1),max(c2),min(1),leastsquares(c1,1,1) from {self.stbname}')
|
tdSql.query(f'select sum(1),max(c2),min(1),leastsquares(c1,1,1) from {self.stbname}')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} group by tbname')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} group by tbname')
|
||||||
tdSql.checkRows(2)
|
tdSql.checkRows(0)
|
||||||
tdSql.checkData(0, 0, 0)
|
|
||||||
tdSql.checkData(1, 0, 0)
|
|
||||||
tdSql.checkData(0, 1, None)
|
|
||||||
tdSql.checkData(1, 1, None)
|
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} group by c1')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} group by c1')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} group by t0')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} partition by tbname')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} partition by c1')
|
||||||
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} partition by t0')
|
||||||
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(1) from (select {function_name}(c1),sum(c1) from {self.stbname} group by c1)')
|
tdSql.query(f'select {function_name}(1) from (select {function_name}(c1),sum(c1) from {self.stbname} group by c1)')
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
tdSql.checkData(0, 0, 0)
|
tdSql.checkData(0, 0, 0)
|
||||||
|
@ -109,15 +113,11 @@ class TDTestCase:
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} partition by c1 interval(1s)')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.stbname} partition by c1 interval(1s)')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select {function_name}(1),sum(1) from (select {function_name}(1) from {self.stbname} group by tbname)')
|
||||||
|
tdSql.checkRows(1)
|
||||||
|
tdSql.checkData(0, 0, 0)
|
||||||
|
tdSql.checkData(0, 1, None)
|
||||||
|
|
||||||
tdSql.query(f'select count(1),sum(1) from (select count(1) from {self.stbname} group by tbname)')
|
|
||||||
tdSql.checkRows(1)
|
|
||||||
tdSql.checkData(0, 0, 2)
|
|
||||||
tdSql.checkData(0, 1, 2)
|
|
||||||
tdSql.query(f'select hyperloglog(1),sum(1) from (select hyperloglog(1) from {self.stbname} group by tbname)')
|
|
||||||
tdSql.checkRows(1)
|
|
||||||
tdSql.checkData(0, 0, 1)
|
|
||||||
tdSql.checkData(0, 1, 2)
|
|
||||||
def query_empty_ntb(self):
|
def query_empty_ntb(self):
|
||||||
tdSql.query(f'select count(*) from {self.ntbname}')
|
tdSql.query(f'select count(*) from {self.ntbname}')
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(1)
|
||||||
|
@ -158,9 +158,7 @@ class TDTestCase:
|
||||||
tdSql.query(f'select sum(1),max(c2),min(1),leastsquares(c1,1,1) from {self.ntbname}')
|
tdSql.query(f'select sum(1),max(c2),min(1),leastsquares(c1,1,1) from {self.ntbname}')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} group by tbname')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} group by tbname')
|
||||||
tdSql.checkRows(1)
|
tdSql.checkRows(0)
|
||||||
tdSql.checkData(0, 0, 0)
|
|
||||||
tdSql.checkData(0, 1, None)
|
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} group by c1')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} group by c1')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(1) from (select {function_name}(c1),sum(c1) from {self.ntbname} group by c1)')
|
tdSql.query(f'select {function_name}(1) from (select {function_name}(c1),sum(c1) from {self.ntbname} group by c1)')
|
||||||
|
@ -172,15 +170,10 @@ class TDTestCase:
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} partition by c1 interval(1s)')
|
tdSql.query(f'select {function_name}(c1),sum(c1) from {self.ntbname} partition by c1 interval(1s)')
|
||||||
tdSql.checkRows(0)
|
tdSql.checkRows(0)
|
||||||
|
tdSql.query(f'select count(1),sum(1) from (select count(1) from {self.ntbname} group by tbname)')
|
||||||
tdSql.query(f'select count(1),sum(1) from (select count(1) from {self.ntbname} group by tbname)')
|
tdSql.checkRows(1)
|
||||||
tdSql.checkRows(1)
|
tdSql.checkData(0, 0, 0)
|
||||||
tdSql.checkData(0, 0, 1)
|
tdSql.checkData(0, 1, None)
|
||||||
tdSql.checkData(0, 1, 1)
|
|
||||||
tdSql.query(f'select hyperloglog(1),sum(1) from (select hyperloglog(1) from {self.ntbname} group by tbname)')
|
|
||||||
tdSql.checkRows(1)
|
|
||||||
tdSql.checkData(0, 0, 1)
|
|
||||||
tdSql.checkData(0, 1, 1)
|
|
||||||
def count_query_stb(self,column_dict,tag_dict,stbname,tbnum,rownum):
|
def count_query_stb(self,column_dict,tag_dict,stbname,tbnum,rownum):
|
||||||
tdSql.query(f'select count(tbname) from {stbname}')
|
tdSql.query(f'select count(tbname) from {stbname}')
|
||||||
tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*rownum)
|
tdSql.checkEqual(tdSql.queryResult[0][0],tbnum*rownum)
|
||||||
|
|
Loading…
Reference in New Issue