From 2f0b6e0086ca5697830e85e77c89d6cb78c9619b Mon Sep 17 00:00:00 2001 From: "wenzhouwww@live.cn" Date: Sat, 16 Jul 2022 14:00:36 +0800 Subject: [PATCH] add test case for last_row --- tests/system-test/2-query/last_row.py | 201 ++++++++++++++------------ 1 file changed, 108 insertions(+), 93 deletions(-) diff --git a/tests/system-test/2-query/last_row.py b/tests/system-test/2-query/last_row.py index a23ee8a86a..a6398fb76f 100644 --- a/tests/system-test/2-query/last_row.py +++ b/tests/system-test/2-query/last_row.py @@ -216,16 +216,11 @@ class TDTestCase: tdSql.execute("use testdb") # bug need fix - # tdSql.query("select last_row(c1 ,NULL) from t1") + tdSql.error("select last_row(c1 ,NULL) from t1") error_sql_lists = [ "select last_row from t1", "select last_row(-+--+c1) from t1", - # "select +-last_row(c1) from t1", - # "select ++-last_row(c1) from t1", - # "select ++--last_row(c1) from t1", - # "select - -last_row(c1)*0 from t1", - # "select last_row(tbname+1) from t1 ", "select last_row(123--123)==1 from t1", "select last_row(c1) as 'd1' from t1", "select last_row(c1 ,NULL) from t1", @@ -233,15 +228,8 @@ class TDTestCase: "select last_row(abs(c1) ab from t1)", "select last_row(c1) as int from t1", "select last_row from stb1", - # "select last_row(-+--+c1) from stb1", - # "select +-last_row(c1) from stb1", - # "select ++-last_row(c1) from stb1", - # "select ++--last_row(c1) from stb1", - # "select - -last_row(c1)*0 from stb1", - # "select last_row(tbname+1) from stb1 ", "select last_row(123--123)==1 from stb1", "select last_row(c1) as 'd1' from stb1", - # "select last_row(c1 ,c2 ) from stb1", "select last_row(c1 ,NULL) from stb1", "select last_row(,) from stb1;", "select last_row(abs(c1) ab from stb1)", @@ -313,12 +301,12 @@ class TDTestCase: tdSql.checkData(0, 4,-9.99000) # bug need fix - # tdSql.query("select last_row(c1), c2, c3 , c4, c5 from stb1 where tbname='ct1'") - # tdSql.checkData(0, 0, 9) - # tdSql.checkData(0, 1, -99999) - # tdSql.checkData(0, 2, -999) - # tdSql.checkData(0, 3, None) - # tdSql.checkData(0, 4,-9.99000) + tdSql.query("select last_row(c1), c2, c3 , c4, c5 from stb1 where tbname='ct1'") + tdSql.checkData(0, 0, 9) + tdSql.checkData(0, 1, -99999) + tdSql.checkData(0, 2, -999) + tdSql.checkData(0, 3, None) + tdSql.checkData(0, 4,-9.99000) # bug fix tdSql.query("select last_row(abs(c1)) from ct1") @@ -342,13 +330,13 @@ class TDTestCase: tdSql.checkData(0,1,None) tdSql.checkData(0,2,None) - # tdSql.query("select last_row(c1 ,c2 ,c3) ,last_row(c4) from stb1 where ts now -1h and ts now -1h and ts now -1h and ts now -1h and ts now -1h and ts now -1h and ts