From 125944ce15893590fdf92803c75597ba9fbe7029 Mon Sep 17 00:00:00 2001 From: "wenzhouwww@live.cn" Date: Fri, 24 Jun 2022 17:05:03 +0800 Subject: [PATCH] add case for compute null value --- tests/system-test/2-query/function_null.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/tests/system-test/2-query/function_null.py b/tests/system-test/2-query/function_null.py index d301fb2ca3..4de7a7f113 100644 --- a/tests/system-test/2-query/function_null.py +++ b/tests/system-test/2-query/function_null.py @@ -92,6 +92,7 @@ class TDTestCase: scalar_sql_1 = f"select {function_name}(c1)/0 from t1 group by c1 order by c1" scalar_sql_2 = f"select {function_name}(c1/0) from t1 group by c1 order by c1" + scalar_sql_3 = f"select {function_name}(NULL) from t1 group by c1 order by c1" tdSql.query(scalar_sql_1) tdSql.checkRows(10) tdSql.checkData(0,0,None) @@ -100,6 +101,10 @@ class TDTestCase: tdSql.checkRows(10) tdSql.checkData(0,0,None) tdSql.checkData(9,0,None) + tdSql.query(scalar_sql_3) + tdSql.checkRows(10) + tdSql.checkData(0,0,None) + tdSql.checkData(9,0,None) function_names = ["sin" ,"cos" ,"tan" ,"asin" ,"acos" ,"atan"] @@ -109,6 +114,9 @@ class TDTestCase: tdSql.query(" select sin(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select sin(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select sin(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,0.000000000) @@ -122,6 +130,9 @@ class TDTestCase: tdSql.query(" select cos(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select cos(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select cos(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,1.000000000) @@ -135,6 +146,9 @@ class TDTestCase: tdSql.query(" select tan(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select tan(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select tan(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,0.000000000) @@ -147,6 +161,9 @@ class TDTestCase: tdSql.query(" select atan(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select atan(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select atan(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,0.000000000) @@ -160,6 +177,9 @@ class TDTestCase: tdSql.query(" select asin(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select asin(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select asin(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,0.000000000) @@ -173,6 +193,9 @@ class TDTestCase: tdSql.query(" select acos(c1/0) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select acos(NULL) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select acos(0.00) from t1 group by c1 order by c1") tdSql.checkData(9,0,1.570796327) @@ -188,6 +211,9 @@ class TDTestCase: tdSql.query(" select log(-10) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select log(NULL ,2) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(" select log(c1)/0 from t1 group by c1 order by c1") tdSql.checkData(9,0,None) @@ -201,6 +227,9 @@ class TDTestCase: tdSql.query(" select pow(c1,2)/0 from t1 group by c1 order by c1") tdSql.checkData(9,0,None) + tdSql.query(" select pow(NULL,2) from t1 group by c1 order by c1") + tdSql.checkData(9,0,None) + tdSql.query(f" select pow(c1/0 ,1 ) from t1 group by c1 order by c1") tdSql.checkData(9,0,None) -- GitLab