diff --git a/tests/pytest/functions/function_count_restart.py b/tests/pytest/functions/function_count_restart.py index 4774aecfb0..565d85f4c0 100644 --- a/tests/pytest/functions/function_count_restart.py +++ b/tests/pytest/functions/function_count_restart.py @@ -63,13 +63,13 @@ class TDTestCase: tdSql.checkData(0, 0, 11) tdSql.query("select count(col11) from test") - tdSql.checkData(0, 0, 10) + tdSql.checkData(0, 0, 11) tdSql.query("select count(col12) from test") - tdSql.checkData(0, 0, 10) + tdSql.checkData(0, 0, 11) tdSql.query("select count(col13) from test") - tdSql.checkData(0, 0, 10) + tdSql.checkData(0, 0, 11) tdSql.query("select count(col14) from test") - tdSql.checkData(0, 0, 10) + tdSql.checkData(0, 0, 11) #tdSql.execute("alter table test add column col10 int") #tdSql.query("select count(col10) from test") diff --git a/tests/pytest/functions/function_diff_restart.py b/tests/pytest/functions/function_diff_restart.py index 647f34d86a..e03b892477 100644 --- a/tests/pytest/functions/function_diff_restart.py +++ b/tests/pytest/functions/function_diff_restart.py @@ -71,14 +71,14 @@ class TDTestCase: tdSql.error("select diff(col8) from test") tdSql.error("select diff(col8) from test1") tdSql.error("select diff(col9) from test") - tdSql.err("select diff(col11) from test1") - tdSql.err("select diff(col12) from test1") - tdSql.err("select diff(col13) from test1") - tdSql.err("select diff(col14) from test1") - tdSql.err("select diff(col11) from test") - tdSql.err("select diff(col12) from test") - tdSql.err("select diff(col13) from test") - tdSql.err("select diff(col14) from test") + tdSql.error("select diff(col11) from test1") + tdSql.error("select diff(col12) from test1") + tdSql.error("select diff(col13) from test1") + tdSql.error("select diff(col14) from test1") + tdSql.error("select diff(col11) from test") + tdSql.error("select diff(col12) from test") + tdSql.error("select diff(col13) from test") + tdSql.error("select diff(col14) from test") tdSql.query("select diff(col1) from test1") tdSql.checkRows(10) diff --git a/tests/pytest/functions/function_leastsquares.py b/tests/pytest/functions/function_leastsquares.py index 4dd645a025..3b2a8486d5 100644 --- a/tests/pytest/functions/function_leastsquares.py +++ b/tests/pytest/functions/function_leastsquares.py @@ -52,10 +52,6 @@ class TDTestCase: tdSql.error("select leastsquares(col12, 1, 1) from test") tdSql.error("select leastsquares(col13, 1, 1) from test") tdSql.error("select leastsquares(col14, 1, 1) from test") - tdSql.error("select leastsquares(col11, 1, 1) from test1") - tdSql.error("select leastsquares(col12, 1, 1) from test1") - tdSql.error("select leastsquares(col13, 1, 1) from test1") - tdSql.error("select leastsquares(col14, 1, 1) from test1") tdSql.query("select leastsquares(col1, 1, 1) from test1") tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') @@ -69,6 +65,18 @@ class TDTestCase: tdSql.query("select leastsquares(col4, 1, 1) from test1") tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + tdSql.query("select leastsquares(col11, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col12, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col13, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col14, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + tdSql.query("select leastsquares(col5, 1, 1) from test1") tdSql.checkData(0, 0, '{slop:1.000000, intercept:-0.900000}') diff --git a/tests/pytest/functions/function_leastsquares_restart.py b/tests/pytest/functions/function_leastsquares_restart.py index 0221dc0aed..8c38d5dd95 100644 --- a/tests/pytest/functions/function_leastsquares_restart.py +++ b/tests/pytest/functions/function_leastsquares_restart.py @@ -54,6 +54,18 @@ class TDTestCase: tdSql.query("select leastsquares(col4, 1, 1) from test1") tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + tdSql.query("select leastsquares(col11, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col12, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col13, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + + tdSql.query("select leastsquares(col14, 1, 1) from test1") + tdSql.checkData(0, 0, '{slop:1.000000, intercept:0.000000}') + tdSql.query("select leastsquares(col5, 1, 1) from test1") tdSql.checkData(0, 0, '{slop:1.000000, intercept:-0.900000}') diff --git a/tests/pytest/functions/function_operations_restart.py b/tests/pytest/functions/function_operations_restart.py index 55febe05d9..e0e9d36e46 100644 --- a/tests/pytest/functions/function_operations_restart.py +++ b/tests/pytest/functions/function_operations_restart.py @@ -45,7 +45,7 @@ class TDTestCase: tdSql.checkData(0, 0, 2.0) tdSql.query("select col1 + col2 * col3 + col3 / col4 + col5 + col6 + col11 + col12 + col13 + col14 from test1") - tdSql.checkRows(10) + tdSql.checkRows(11) tdSql.checkData(0, 0, 7.2) #tdSql.execute("insert into test1(ts, col1) values(%d, 11)" % (self.ts + 11)) diff --git a/tests/pytest/functions/function_spread.py b/tests/pytest/functions/function_spread.py index 00de25bcd4..b40f57b78d 100644 --- a/tests/pytest/functions/function_spread.py +++ b/tests/pytest/functions/function_spread.py @@ -55,6 +55,22 @@ class TDTestCase: tdSql.checkRows(1) tdSql.checkData(0, 0, 0) + tdSql.query("select spread(col11) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 0) + + tdSql.query("select spread(col12) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 0) + + tdSql.query("select spread(col13) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 0) + + tdSql.query("select spread(col14) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 0) + tdSql.query("select spread(col5) from test1") tdSql.checkRows(1) tdSql.checkData(0, 0, 0) @@ -73,14 +89,6 @@ class TDTestCase: tdSql.error("select spread(col8) from test1") tdSql.error("select spread(col9) from test") tdSql.error("select spread(col9) from test1") - tdSql.error("select spread(col11) from test") - tdSql.error("select spread(col11) from test1") - tdSql.error("select spread(col12) from test") - tdSql.error("select spread(col12) from test1") - tdSql.error("select spread(col13) from test") - tdSql.error("select spread(col13) from test1") - tdSql.error("select spread(col14) from test") - tdSql.error("select spread(col14) from test1") tdSql.query("select spread(col1) from test1") tdSql.checkRows(1) @@ -98,6 +106,22 @@ class TDTestCase: tdSql.checkRows(1) tdSql.checkData(0, 0, 10) + tdSql.query("select spread(col11) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col12) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col13) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col14) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + tdSql.query("select spread(col5) from test1") tdSql.checkRows(1) tdSql.checkData(0, 0, 9.1) diff --git a/tests/pytest/functions/function_spread_restart.py b/tests/pytest/functions/function_spread_restart.py index 360b355d84..134d92c9c3 100644 --- a/tests/pytest/functions/function_spread_restart.py +++ b/tests/pytest/functions/function_spread_restart.py @@ -36,16 +36,8 @@ class TDTestCase: tdSql.error("select spread(col8) from test1") tdSql.error("select spread(col9) from test") tdSql.error("select spread(col9) from test1") - tdSql.error("select spread(col11) from test") - tdSql.error("select spread(col11) from test1") - tdSql.error("select spread(col12) from test") - tdSql.error("select spread(col12) from test1") - tdSql.error("select spread(col13) from test") - tdSql.error("select spread(col13) from test1") - tdSql.error("select spread(col14) from test") - tdSql.error("select spread(col14) from test1") - tdSql.query("select spread(col1) from test1") + tdSql.query("select spread(col1) from test1") tdSql.checkRows(1) tdSql.checkData(0, 0, 10) @@ -61,6 +53,23 @@ class TDTestCase: tdSql.checkRows(1) tdSql.checkData(0, 0, 10) + tdSql.query("select spread(col11) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col12) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col13) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col14) from test1") + tdSql.checkRows(1) + tdSql.checkData(0, 0, 10) + + tdSql.query("select spread(col5) from test1") tdSql.checkRows(1) tdSql.checkData(0, 0, 9.1) diff --git a/tests/pytest/insert/unsigenedSmallint.py b/tests/pytest/insert/unsigenedSmallint.py deleted file mode 100644 index 622e6f5572..0000000000 --- a/tests/pytest/insert/unsigenedSmallint.py +++ /dev/null @@ -1,108 +0,0 @@ -# -*- coding: utf-8 -*- - -import sys -from util.log import * -from util.cases import * -from util.sql import * - - -class TDTestCase: - def init(self, conn, logSql): - tdLog.debug("start to execute %s" % __file__) - tdSql.init(conn.cursor(), logSql) - - def run(self): - tdSql.prepare() - - tdLog.info('=============== step1') - tdLog.info('create table tb (ts timestamp, speed smallint unsigned)') - tdSql.execute('create table tb (ts timestamp, speed smallint unsigned)') - tdLog.info("insert into tb values (now, NULL)") - tdSql.execute("insert into tb values (now, NULL)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(1)') - tdSql.checkRows(1) - tdLog.info('tdSql.checkData(0, 1, null)') - tdSql.checkData(0, 1, None) - tdLog.info('=============== step2') - tdLog.info("insert into tb values (now+1m, -1) -x step2") - tdSql.error("insert into tb values (now+1m, -1) ") - tdLog.info("insert into tb values (now+1m, NULL)") - tdSql.execute("insert into tb values (now+1m, NULL)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(2)') - tdSql.checkRows(2) - tdLog.info('tdSql.checkData(0, 1, null)') - tdSql.checkData(0, 1, None) - tdLog.info('=============== step3') - tdLog.info("insert into tb values (now+2m, 4294967294)") - tdSql.execute("insert into tb values (now+2m, 4294967294)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(3)') - tdSql.checkRows(3) - tdLog.info('tdSql.checkData(0, 1, 254)') - tdSql.checkData(0, 1, 254) - tdLog.info('=============== step4') - tdLog.info("insert into tb values (now+3m, 4294967295) -x step4") - tdSql.error("insert into tb values (now+3m, 4294967295)") - tdLog.info("insert into tb values (now+3m, NULL)") - tdSql.execute("insert into tb values (now+3m, NULL)") - tdLog.info('select * from tb') - tdSql.query('select * from tb') - tdLog.info('tdSql.checkRow(4)') - tdSql.checkRows(4) - tdLog.info('tdSql.checkData(0, 1, null)') - tdSql.checkData(0, 1, None) - tdLog.info('=============== step5') - tdLog.info("insert into tb values (now+4m, a2)") - tdSql.error("insert into tb values (now+4m, a2)") - tdLog.info("insert into tb values (now-4m, -1)") - tdSql.error("insert into tb values (now-4m, -1)") - tdLog.info("insert into tb values (now+4m, 0)") - tdSql.execute("insert into tb values (now+4m, 0)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(5)') - tdSql.checkRows(5) - tdLog.info('tdSql.checkData(0, 1, 0)') - tdSql.checkData(0, 1, 0) - tdLog.info('=============== step6') - tdLog.info("insert into tb values (now+5m, 2a)") - tdSql.error("insert into tb values (now+5m, 2a)") - tdLog.info("insert into tb values (now+5m, 2)") - tdSql.execute("insert into tb values (now+5m, 2)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(6)') - tdSql.checkRows(6) - tdLog.info('tdSql.checkData(0, 1, 2)') - tdSql.checkData(0, 1, 2) - tdLog.info('=============== step7') - tdLog.info("insert into tb values (now+6m, 2a'1)") - tdSql.error("insert into tb values (now+6m, 2a'1)") - tdLog.info("insert into tb values (now+6m, 2)") - tdSql.execute("insert into tb values (now+6m, 2)") - tdLog.info('select * from tb order by ts desc') - tdSql.query('select * from tb order by ts desc') - tdLog.info('tdSql.checkRow(7)') - tdSql.checkRows(7) - tdLog.info('tdSql.checkData(0, 1, 2)') - tdSql.checkData(0, 1, 2) - tdLog.info('drop database db') - tdSql.execute('drop database db') - tdLog.info('show databases') - tdSql.query('show databases') - tdLog.info('tdSql.checkRow(0)') - tdSql.checkRows(0) -# convert end - - def stop(self): - tdSql.close() - tdLog.success("%s successfully executed" % __file__) - - -tdCases.addWindows(__file__, TDTestCase()) -tdCases.addLinux(__file__, TDTestCase()) diff --git a/tests/pytest/insert/unsigenedBigint.py b/tests/pytest/insert/unsignedBigint.py similarity index 100% rename from tests/pytest/insert/unsigenedBigint.py rename to tests/pytest/insert/unsignedBigint.py diff --git a/tests/pytest/insert/unsigenedInt.py b/tests/pytest/insert/unsignedInt.py similarity index 100% rename from tests/pytest/insert/unsigenedInt.py rename to tests/pytest/insert/unsignedInt.py diff --git a/tests/pytest/insert/unsigenedTinyint.py b/tests/pytest/insert/unsignedTinyint.py similarity index 100% rename from tests/pytest/insert/unsigenedTinyint.py rename to tests/pytest/insert/unsignedTinyint.py diff --git a/tests/pytest/tag_lite/delete.py b/tests/pytest/tag_lite/delete.py index 77a5972b1a..5e82a96bf4 100644 --- a/tests/pytest/tag_lite/delete.py +++ b/tests/pytest/tag_lite/delete.py @@ -954,8 +954,6 @@ class TDTestCase: tdSql.execute('alter table %s drop tag tgcol6' % (mt)) tdLog.info('alter table %s drop tag tgcol8' % (mt)) tdSql.execute('alter table %s drop tag tgcol8' % (mt)) - tdLog.info('alter table %s drop tag tgcol9' % (mt)) - tdSql.execute('alter table %s drop tag tgcol9' % (mt)) # TSIM: # TSIM: sleep 5000 # TSIM: @@ -1643,7 +1641,7 @@ class TDTestCase: # TSIM: print =============== step14 tdLog.info('=============== step14') # TSIM: $i = 14 - i = 14 + i = 20 # TSIM: $mt = $mtPrefix . $i mt = "%s%d" % (mtPrefix, i) # TSIM: $tb = $tbPrefix . $i