提交 f63f60b5 编写于 作者: L liuyq-617

modify

上级 8378850b
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
...@@ -63,7 +63,15 @@ class TDTestCase: ...@@ -63,7 +63,15 @@ class TDTestCase:
tdSql.query("select avg(col5) from test") tdSql.query("select avg(col5) from test")
tdSql.checkData(0, 0, np.average(floatData)) tdSql.checkData(0, 0, np.average(floatData))
tdSql.query("select avg(col6) from test") tdSql.query("select avg(col6) from test")
tdSql.checkData(0, 0, np.average(floatData)) tdSql.checkData(0, 0, np.average(floatData))
tdSql.query("select avg(col11) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col12) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col13) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col14) from test")
tdSql.checkData(0, 0, np.average(intData))
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, #tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') # col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')") #tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
#tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" #tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) # % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
...@@ -63,7 +63,15 @@ class TDTestCase: ...@@ -63,7 +63,15 @@ class TDTestCase:
tdSql.query("select avg(col5) from test") tdSql.query("select avg(col5) from test")
tdSql.checkData(0, 0, np.average(floatData)) tdSql.checkData(0, 0, np.average(floatData))
tdSql.query("select avg(col6) from test") tdSql.query("select avg(col6) from test")
tdSql.checkData(0, 0, np.average(floatData)) tdSql.checkData(0, 0, np.average(floatData))
tdSql.query("select avg(col11) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col12) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col13) from test")
tdSql.checkData(0, 0, np.average(intData))
tdSql.query("select avg(col14) from test")
tdSql.checkData(0, 0, np.average(intData))
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# bottom verifacation # bottom verifacation
tdSql.error("select bottom(ts, 10) from test") tdSql.error("select bottom(ts, 10) from test")
...@@ -84,6 +84,26 @@ class TDTestCase: ...@@ -84,6 +84,26 @@ class TDTestCase:
tdSql.checkRows(2) tdSql.checkRows(2)
tdSql.checkData(0, 1, 0.1) tdSql.checkData(0, 1, 0.1)
tdSql.checkData(1, 1, 1.1) tdSql.checkData(1, 1, 1.1)
tdSql.query("select bottom(col11, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col12, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col13, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col14, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
#TD-2457 bottom + interval + order by #TD-2457 bottom + interval + order by
tdSql.error('select top(col2,1) from test interval(1y) order by col2;') tdSql.error('select top(col2,1) from test interval(1y) order by col2;')
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.execute("use db") tdSql.execute("use db")
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, #tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') # col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')") #tdSql.execute("create table test1 using test tags('beijing')")
#for i in range(self.rowNum): #for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" # tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) # % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# bottom verifacation # bottom verifacation
tdSql.error("select bottom(ts, 10) from test") tdSql.error("select bottom(ts, 10) from test")
...@@ -75,6 +75,26 @@ class TDTestCase: ...@@ -75,6 +75,26 @@ class TDTestCase:
tdSql.checkData(0, 1, 1) tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2) tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col11, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col12, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col13, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col14, 2) from test")
tdSql.checkRows(2)
tdSql.checkData(0, 1, 1)
tdSql.checkData(1, 1, 2)
tdSql.query("select bottom(col5, 2) from test") tdSql.query("select bottom(col5, 2) from test")
tdSql.checkRows(2) tdSql.checkRows(2)
tdSql.checkData(0, 1, 0.1) tdSql.checkData(0, 1, 0.1)
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# Count verifacation # Count verifacation
tdSql.query("select count(*) from test") tdSql.query("select count(*) from test")
...@@ -62,11 +62,20 @@ class TDTestCase: ...@@ -62,11 +62,20 @@ class TDTestCase:
tdSql.query("select count(col9) from test") tdSql.query("select count(col9) from test")
tdSql.checkData(0, 0, 10) tdSql.checkData(0, 0, 10)
tdSql.query("select count(col11) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col12) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col13) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col14) from test")
tdSql.checkData(0, 0, 10)
tdSql.execute("alter table test add column col10 int") tdSql.execute("alter table test add column col10 int")
tdSql.query("select count(col10) from test") tdSql.query("select count(col10) from test")
tdSql.checkRows(0) tdSql.checkRows(0)
tdSql.execute("insert into test1 values(now, 1, 2, 3, 4, 1.1, 2.2, false, 'test', 'test' 1)") 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") tdSql.query("select count(col10) from test")
tdSql.checkData(0, 0, 1) tdSql.checkData(0, 0, 1)
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.execute("use db") tdSql.execute("use db")
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, #tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') # col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')") #tdSql.execute("create table test1 using test tags('beijing')")
#for i in range(self.rowNum): #for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" # tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) # % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# Count verifacation # Count verifacation
tdSql.query("select count(*) from test") tdSql.query("select count(*) from test")
...@@ -62,6 +62,15 @@ class TDTestCase: ...@@ -62,6 +62,15 @@ class TDTestCase:
tdSql.query("select count(col9) from test") tdSql.query("select count(col9) from test")
tdSql.checkData(0, 0, 11) tdSql.checkData(0, 0, 11)
tdSql.query("select count(col11) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col12) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col13) from test")
tdSql.checkData(0, 0, 10)
tdSql.query("select count(col14) from test")
tdSql.checkData(0, 0, 10)
#tdSql.execute("alter table test add column col10 int") #tdSql.execute("alter table test add column col10 int")
#tdSql.query("select count(col10) from test") #tdSql.query("select count(col10) from test")
#tdSql.checkRows(0) #tdSql.checkRows(0)
......
...@@ -31,9 +31,9 @@ class TDTestCase: ...@@ -31,9 +31,9 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1)) tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ', 0, 0, 0, 0)" % (self.ts - 1))
# diff verifacation # diff verifacation
tdSql.query("select diff(col1) from test1") tdSql.query("select diff(col1) from test1")
...@@ -54,9 +54,21 @@ class TDTestCase: ...@@ -54,9 +54,21 @@ class TDTestCase:
tdSql.query("select diff(col6) from test1") tdSql.query("select diff(col6) from test1")
tdSql.checkRows(0) tdSql.checkRows(0)
tdSql.query("select diff(col11) from test1")
tdSql.checkRows(0)
tdSql.query("select diff(col12) from test1")
tdSql.checkRows(0)
tdSql.query("select diff(col13) from test1")
tdSql.checkRows(0)
tdSql.query("select diff(col14) from test1")
tdSql.checkRows(0)
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.error("select diff(ts) from test") tdSql.error("select diff(ts) from test")
tdSql.error("select diff(ts) from test1") tdSql.error("select diff(ts) from test1")
...@@ -85,6 +97,18 @@ class TDTestCase: ...@@ -85,6 +97,18 @@ class TDTestCase:
tdSql.query("select diff(col4) from test1") tdSql.query("select diff(col4) from test1")
tdSql.checkRows(10) tdSql.checkRows(10)
tdSql.query("select diff(col11) from test1")
tdSql.checkRows(10)
tdSql.query("select diff(col12) from test1")
tdSql.checkRows(10)
tdSql.query("select diff(col13) from test1")
tdSql.checkRows(10)
tdSql.query("select diff(col14) from test1")
tdSql.checkRows(10)
tdSql.query("select diff(col5) from test1") tdSql.query("select diff(col5) from test1")
tdSql.checkRows(10) tdSql.checkRows(10)
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
tdSql.execute("use db") tdSql.execute("use db")
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, #tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') # col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')") #tdSql.execute("create table test1 using test tags('beijing')")
#tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1)) #tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1))
...@@ -55,8 +55,8 @@ class TDTestCase: ...@@ -55,8 +55,8 @@ class TDTestCase:
#tdSql.checkRows(0) #tdSql.checkRows(0)
#for i in range(self.rowNum): #for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" # tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) # % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.error("select diff(ts) from test") tdSql.error("select diff(ts) from test")
tdSql.error("select diff(ts) from test1") tdSql.error("select diff(ts) from test1")
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1)) tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1))
...@@ -68,8 +68,8 @@ class TDTestCase: ...@@ -68,8 +68,8 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select first(*) from test1") tdSql.query("select first(*) from test1")
tdSql.checkRows(1) tdSql.checkRows(1)
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1)) tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1))
...@@ -68,8 +68,8 @@ class TDTestCase: ...@@ -68,8 +68,8 @@ class TDTestCase:
tdSql.checkRows(0) tdSql.checkRows(0)
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select last(*) from test1") tdSql.query("select last(*) from test1")
tdSql.checkRows(1) tdSql.checkRows(1)
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1)) tdSql.execute("insert into test1(ts) values(%d)" % (self.ts - 1))
...@@ -77,8 +77,8 @@ class TDTestCase: ...@@ -77,8 +77,8 @@ class TDTestCase:
tdSql.checkData(0, 0, None) tdSql.checkData(0, 0, None)
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.query("select last_row(*) from test1") tdSql.query("select last_row(*) from test1")
tdSql.checkRows(1) tdSql.checkRows(1)
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# leastsquares verifacation # leastsquares verifacation
tdSql.error("select leastsquares(ts, 1, 1) from test1") tdSql.error("select leastsquares(ts, 1, 1) from test1")
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -34,7 +34,7 @@ class TDTestCase: ...@@ -34,7 +34,7 @@ class TDTestCase:
floatData = [] floatData = []
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, #tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') # col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')") #tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
intData.append(i + 1) intData.append(i + 1)
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -31,11 +31,11 @@ class TDTestCase: ...@@ -31,11 +31,11 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# min verifacation # min verifacation
tdSql.error("select ts + col1 from test") tdSql.error("select ts + col1 from test")
......
...@@ -34,10 +34,10 @@ class TDTestCase: ...@@ -34,10 +34,10 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned)''')
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -31,7 +31,7 @@ class TDTestCase: ...@@ -31,7 +31,7 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1)) tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1))
...@@ -64,8 +64,8 @@ class TDTestCase: ...@@ -64,8 +64,8 @@ class TDTestCase:
tdSql.checkData(0, 0, 0) tdSql.checkData(0, 0, 0)
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
tdSql.error("select spread(col7) from test") tdSql.error("select spread(col7) from test")
tdSql.error("select spread(col7) from test1") tdSql.error("select spread(col7) from test1")
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -42,15 +42,15 @@ class TDTestCase: ...@@ -42,15 +42,15 @@ class TDTestCase:
tdSql.prepare() tdSql.prepare()
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(cid int,gbid binary(20),loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(cid int,gbid binary(20),loc nchar(20))''')
tdSql.execute("create table test1 using test tags(1,'beijing','北京')") tdSql.execute("create table test1 using test tags(1,'beijing','北京')")
tdSql.execute("create table test2 using test tags(2,'shanghai','深圳')") tdSql.execute("create table test2 using test tags(2,'shanghai','深圳')")
tdSql.execute("create table test3 using test tags(2,'shenzhen','深圳')") tdSql.execute("create table test3 using test tags(2,'shenzhen','深圳')")
tdSql.execute("create table test4 using test tags(1,'shanghai','上海')") tdSql.execute("create table test4 using test tags(1,'shanghai','上海')")
for j in range(4): for j in range(4):
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test%d values(now-%dh, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test%d values(now-%dh, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (j+1,i, i + 1, i + 1, i + 1, i + 1, i + i * 0.1, i * 1.5, i % 2, i + 1, i + 1)) % (j+1,i, i + 1, i + 1, i + 1, i + 1, i + i * 0.1, i * 1.5, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
# stddev verifacation # stddev verifacation
tdSql.error("select stddev(ts) from test") tdSql.error("select stddev(ts) from test")
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
...@@ -34,11 +34,11 @@ class TDTestCase: ...@@ -34,11 +34,11 @@ class TDTestCase:
floatData = [] floatData = []
tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double, tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''') col7 bool, col8 binary(20), col9 nchar(20), col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned) tags(loc nchar(20))''')
tdSql.execute("create table test1 using test tags('beijing')") tdSql.execute("create table test1 using test tags('beijing')")
for i in range(self.rowNum): for i in range(self.rowNum):
tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')" tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d', %d, %d, %d, %d)"
% (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1)) % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1, i + 1, i + 1, i + 1, i + 1))
intData.append(i + 1) intData.append(i + 1)
floatData.append(i + 0.1) floatData.append(i + 0.1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册