From cc7ff424f1557cf88f87ee547b0c0e58b6212329 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 24 Nov 2021 14:27:38 +0800 Subject: [PATCH] [TS-706]count(tbname) disabled test coverage --- tests/pytest/functions/function_count.py | 19 +++++++++++++++++++ tests/pytest/query/udf.py | 1 + 2 files changed, 20 insertions(+) diff --git a/tests/pytest/functions/function_count.py b/tests/pytest/functions/function_count.py index 9812473d64..a05b2b0720 100644 --- a/tests/pytest/functions/function_count.py +++ b/tests/pytest/functions/function_count.py @@ -74,6 +74,25 @@ class TDTestCase: tdSql.execute("alter table test add column col10 int") tdSql.query("select count(col10) from test") tdSql.checkRows(0) + + #TS-653 forbidden count(tbname) to mix up with agg, proj etc. + tdSql.error("select count(*),count(tbname) from test") + tdSql.error("select col11,count(tbname) from test;") + tdSql.error("select count(tbname),count(*) from test") + tdSql.error("select count(tbname),col11 from test;") + func_list=['avg','count','twa','sum','stddev','leastsquares','min', + 'max','first','last','top','bottom','percentile','apercentile', + 'last_row','diff','spread' + ] + for j in func_list: + if j == 'leastsquares': + pick_func=j+'(col1,1,1)' + elif j == 'top' or j == 'bottom' or j == 'percentile' or j == 'apercentile': + pick_func=j+'(col1,1)' + else: + pick_func=j+'(col)' + tdSql.error("select {0},count(tbname) from test".format(pick_func)) + tdSql.error("select count(tbname),{0} from test".format(pick_func)) tdSql.execute("insert into test1 values(now, 1, 2, 3, 4, 1.1, 2.2, false, 'test', 'test' , 1, 1, 1, 1, 1)") tdSql.query("select count(col10) from test") diff --git a/tests/pytest/query/udf.py b/tests/pytest/query/udf.py index e9fc42c72e..7e04f8ad72 100644 --- a/tests/pytest/query/udf.py +++ b/tests/pytest/query/udf.py @@ -155,6 +155,7 @@ class TDTestCase: sys.exit() tdSql.query("select abs_max(val) from st") + tdSql.error("select abs_max(val),count(tbname) from st") tdSql.query("select abs_max(val) from tb1") tdSql.checkRows(0) tdSql.query("select sum_double(val) from st") -- GitLab