tdLog.debug("spent %.2fs to create %d stable and %d table, create speed is %.2f table/s... [OK]"%(spendTime,threadNumbers,threadNumbers*count,speedCreate))
tdLog.debug("spent %.2fs to create %d stable and %d table, create speed is %.2f table/s... [OK]"%(spendTime,threadNumbers,threadNumbers*count,speedCreate))
tableCounts=threadNumbers*chilCount
stableRows=chilCount*childrowcount
allRows=stableRows*threadNumbers
speedInsert=allRows/spendTime
foriinrange(threadNumbers):
tdSql.execute("use %s"%dbname)
tdSql.query("select count(*) from %s%d"%(stbname,i))
tdSql.checkData(0,0,stableRows)
tdLog.debug("spent %.2fs to insert %d rows into %d stable and %d table, speed is %.2f table/s... [OK]"%(spendTime,allRows,threadNumbers,tableCounts,speedInsert))
tdLog.debug("INSERT TABLE DATA ............ [OK]")
return
...
...
@@ -288,7 +268,10 @@ class TDTestCase:
deftest_case1(self):
tdLog.debug("-----create database and muti-thread create tables test------- ")
q_u_or_where=['(t1.q_binary like \'binary%\' or t1.q_binary = \'0\' or t2.q_binary like \'binary%\' or t2.q_binary = \'0\' )',
'(t1.q_nchar like \'nchar%\' or t1.q_nchar = \'0\' or t2.q_nchar like \'nchar%\' or t2.q_nchar = \'0\' )','(t1.q_bool = true or t1.q_bool = false or t2.q_bool = true or t2.q_bool = false)',
'(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1)','t1.q_bool in ( true , false) or t2.q_bool in ( true , false))','(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)',
'(t1.q_bool in (0 , 1) or t2.q_bool in (0 , 1))','(t1.q_bool in ( true , false) or t2.q_bool in ( true , false))','(t1.q_bool = 0 or t1.q_bool = 1 or t2.q_bool = 0 or t2.q_bool = 1)',
'(t1.q_bigint between -9223372036854775807 and 9223372036854775807 or t2.q_bigint between -9223372036854775807 and 9223372036854775807)',
'(t1.q_int between -2147483647 and 2147483647 or t2.q_int between -2147483647 and 2147483647)',
'(t1.q_smallint between -32767 and 32767 or t2.q_smallint between -32767 and 32767)',
...
...
@@ -315,7 +369,63 @@ class TDTestCase:
group_where=['group by tbname , loc','group by tbname','group by tbname, t_bigint','group by tbname,t_int','group by tbname, t_smallint','group by tbname,t_tinyint',
'group by tbname,t_float','group by tbname,t_double','group by tbname,t_binary','group by tbname,t_nchar','group by tbname,t_bool','group by tbname ,loc ,t_bigint',
'group by tbname,t_binary ,t_nchar ,t_bool','group by tbname,t_int ,t_smallint ,t_tinyint','group by tbname,t_float ,t_double ']
'group by tbname,t_binary ,t_nchar ,t_bool','group by tbname,t_int ,t_smallint ,t_tinyint','group by tbname,t_float ,t_double ',
'PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float','PARTITION BY tbname,t_double','PARTITION BY tbname,t_binary','PARTITION BY tbname,t_nchar','PARTITION BY tbname,t_bool','PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool','PARTITION BY tbname,t_int ,t_smallint ,t_tinyint','PARTITION BY tbname,t_float ,t_double ']
group_where_j=['group by t1.loc','group by t1.t_bigint','group by t1.t_int','group by t1.t_smallint','group by t1.t_tinyint',
'group by t1.t_float','group by t1.t_double','group by t1.t_binary','group by t1.t_nchar','group by t1.t_bool','group by t1.loc ,t1.t_bigint',
'group by t1.t_binary ,t1.t_nchar ,t1.t_bool','group by t1.t_int ,t1.t_smallint ,t1.t_tinyint','group by t1.t_float ,t1.t_double ',
'PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float','PARTITION by t1.t_double','PARTITION by t1.t_binary','PARTITION by t1.t_nchar','PARTITION by t1.t_bool','PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool','PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint','PARTITION by t1.t_float ,t1.t_double ',
'group by t2.loc','group by t2.t_bigint','group by t2.t_int','group by t2.t_smallint','group by t2.t_tinyint',
'group by t2.t_float','group by t2.t_double','group by t2.t_binary','group by t2.t_nchar','group by t2.t_bool','group by t2.loc ,t2.t_bigint',
'group by t2.t_binary ,t2.t_nchar ,t2.t_bool','group by t2.t_int ,t2.t_smallint ,t2.t_tinyint','group by t2.t_float ,t2.t_double ',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float','PARTITION by t2.t_double','PARTITION by t2.t_binary','PARTITION by t2.t_nchar','PARTITION by t2.t_bool','PARTITION BY t2.loc ,t2.t_bigint',
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
partiton_where=['PARTITION BY tbname , loc','PARTITION BY tbname','PARTITION BY tbname, t_bigint','PARTITION BY tbname,t_int','PARTITION BY tbname, t_smallint','PARTITION BY tbname,t_tinyint',
'PARTITION BY tbname,t_float','PARTITION BY tbname,t_double','PARTITION BY tbname,t_binary','PARTITION BY tbname,t_nchar','PARTITION BY tbname,t_bool','PARTITION BY tbname ,loc ,t_bigint',
'PARTITION BY tbname,t_binary ,t_nchar ,t_bool','PARTITION BY tbname,t_int ,t_smallint ,t_tinyint','PARTITION BY tbname,t_float ,t_double ']
partiton_where_j=['PARTITION BY t1.loc','PARTITION by t1.t_bigint','PARTITION by t1.t_int','PARTITION by t1.t_smallint','PARTITION by t1.t_tinyint',
'PARTITION by t1.t_float','PARTITION by t1.t_double','PARTITION by t1.t_binary','PARTITION by t1.t_nchar','PARTITION by t1.t_bool','PARTITION BY t1.loc ,t1.t_bigint',
'PARTITION by t1.t_binary ,t1.t_nchar ,t1.t_bool','PARTITION by t1.t_int ,t1.t_smallint ,t1.t_tinyint','PARTITION by t1.t_float ,t1.t_double ',
'PARTITION BY t2.loc','PARTITION by t2.t_bigint','PARTITION by t2.t_int','PARTITION by t2.t_smallint','PARTITION by t2.t_tinyint',
'PARTITION by t2.t_float','PARTITION by t2.t_double','PARTITION by t2.t_binary','PARTITION by t2.t_nchar','PARTITION by t2.t_bool','PARTITION BY t2.loc ,t2.t_bigint',
'PARTITION by t2.t_binary ,t2.t_nchar ,t2.t_bool','PARTITION by t2.t_int ,t2.t_smallint ,t2.t_tinyint','PARTITION by t2.t_float ,t2.t_double ']
group_where_regular=['group by tbname ','group by tbname','group by tbname, q_bigint','group by tbname,q_int','group by tbname, q_smallint','group by tbname,q_tinyint',
'group by tbname,q_float','group by tbname,q_double','group by tbname,q_binary','group by tbname,q_nchar','group by tbname,q_bool','group by tbname ,q_bigint',
'group by tbname,q_binary ,q_nchar ,q_bool','group by tbname,q_int ,q_smallint ,q_tinyint','group by tbname,q_float ,q_double ',
'PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float','PARTITION BY tbname,q_double','PARTITION BY tbname,q_binary','PARTITION BY tbname,q_nchar','PARTITION BY tbname,q_bool','PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool','PARTITION BY tbname,q_int ,q_smallint ,q_tinyint','PARTITION BY tbname,q_float ,q_double ']
group_where_regular_j=['group by t1.q_bigint','group by t1.q_int','group by t1.q_smallint','group by t1.q_tinyint',
'group by t1.q_float','group by t1.q_double','group by t1.q_binary','group by t1.q_nchar','group by t1.q_bool','group by t1.q_bigint',
'group by t1.q_binary ,t1.q_nchar ,t1.q_bool','group by t1.q_int ,t1.q_smallint ,t1.q_tinyint','group by t1.q_float ,t1.q_double ',
'PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float','PARTITION by t1.q_double','PARTITION by t1.q_binary','PARTITION by t1.q_nchar','PARTITION by t1.q_bool','PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool','PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint','PARTITION by t1.q_float ,t1.q_double ',
'group by t2.q_bigint','group by t2.q_int','group by t2.q_smallint','group by t2.q_tinyint',
'group by t2.q_float','group by t2.q_double','group by t2.q_binary','group by t2.q_nchar','group by t2.q_bool','group by t2.q_bigint',
'group by t2.q_binary ,t2.q_nchar ,t2.q_bool','group by t2.q_int ,t2.q_smallint ,t2.q_tinyint','group by t2.q_float ,t2.q_double ',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float','PARTITION by t2.q_double','PARTITION by t2.q_binary','PARTITION by t2.q_nchar','PARTITION by t2.q_bool','PARTITION BY t2.q_bigint',
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
partiton_where_regular=['PARTITION BY tbname ','PARTITION BY tbname','PARTITION BY tbname, q_bigint','PARTITION BY tbname,q_int','PARTITION BY tbname, q_smallint','PARTITION BY tbname,q_tinyint',
'PARTITION BY tbname,q_float','PARTITION BY tbname,q_double','PARTITION BY tbname,q_binary','PARTITION BY tbname,q_nchar','PARTITION BY tbname,q_bool','PARTITION BY tbname ,q_bigint',
'PARTITION BY tbname,q_binary ,q_nchar ,q_bool','PARTITION BY tbname,q_int ,q_smallint ,q_tinyint','PARTITION BY tbname,q_float ,q_double ']
partiton_where_regular_j=['PARTITION by t1.q_bigint','PARTITION by t1.q_int','PARTITION by t1.q_smallint','PARTITION by t1.q_tinyint',
'PARTITION by t1.q_float','PARTITION by t1.q_double','PARTITION by t1.q_binary','PARTITION by t1.q_nchar','PARTITION by t1.q_bool','PARTITION BY t1.q_bigint',
'PARTITION by t1.q_binary ,t1.q_nchar ,t1.q_bool','PARTITION by t1.q_int ,t1.q_smallint ,t1.q_tinyint','PARTITION by t1.q_float ,t1.q_double ',
'PARTITION by t2.q_bigint','PARTITION by t2.q_int','PARTITION by t2.q_smallint','PARTITION by t2.q_tinyint',
'PARTITION by t2.q_float','PARTITION by t2.q_double','PARTITION by t2.q_binary','PARTITION by t2.q_nchar','PARTITION by t2.q_bool','PARTITION BY t2.q_bigint',
'PARTITION by t2.q_binary ,t2.q_nchar ,t2.q_bool','PARTITION by t2.q_int ,t2.q_smallint ,t2.q_tinyint','PARTITION by t2.q_float ,t2.q_double ']
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1453,8 +1671,7 @@ class TDTestCase:
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(1)
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-4.2 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1466,7 +1683,7 @@ class TDTestCase:
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.error(sql)
#tdSql.query(sql)#Invalid function name: derivative'
tdSql.query("select 16-5 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1477,13 +1694,13 @@ class TDTestCase:
sql+=" from stable_1 where "
sql+="%s "%random.choice(q_where)
sql+="%s "%random.choice(group_where)
sql+="%s "%random.choice(having_support)
#sql += "%s " % random.choice(having_support)
sql+=") "
sql+="order by calc16_1 "
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.error(sql)
# tdSql.query(sql)
tdSql.query("select 16-6 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1496,8 +1713,7 @@ class TDTestCase:
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.query(sql)
# tdSql.checkRows(1)
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-7 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1509,7 +1725,7 @@ class TDTestCase:
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.error(sql)
#Invalid function name: derivative' tdSql.query(sql)
tdSql.query("select 16-8 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1521,7 +1737,7 @@ class TDTestCase:
sql+="%s "%random.choice(limit1_where)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.error(sql)
#Invalid function name: derivative' tdSql.query(sql)
#17 select apercentile from (select calc_aggregate_alls form regualr_table or stable where <\>\in\and\or interval_sliding group by having order by limit offset )interval_sliding
#self.dropandcreateDB_random("%s" %db, 1)
...
...
@@ -1534,16 +1750,16 @@ class TDTestCase:
sql+="%s as cal17_2 "%random.choice(calc_aggregate_all)
sql+=" from stable_1 where "
sql+="%s "%random.choice(qt_where)
sql+="%s "%random.choice(partiton_where)
sql+="%s "%random.choice(interval_sliding)
sql+="%s "%random.choice(group_where)
sql+="%s "%random.choice(having_support)
sql+="%s "%random.choice(order_where)
#sql += "%s " % random.choice(having_support)
#sql += "%s " % random.choice(order_where)
sql+="%s "%random.choice(limit1_where)
sql+=") "
sql+="%s "%random.choice(interval_sliding)
#sql += "%s " % random.choice(interval_sliding)
tdLog.info(sql)
tdLog.info(len(sql))
#tdSql.query(sql)
#TD-15719 tdSql.query(sql)
tdSql.query("select 17-2 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1555,13 +1771,13 @@ class TDTestCase:
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(t_join_where)
sql+="%s "%random.choice(interval_sliding)
sql+="%s "%random.choice(order_u_where)
#sql += "%s " % random.choice(order_u_where)
sql+="%s "%random.choice(limit_u_where)
sql+=") "
sql+="%s "%random.choice(interval_sliding)
#sql += "%s " % random.choice(interval_sliding)
tdLog.info(sql)
tdLog.info(len(sql))
#Column ambiguously defined: ts tdSql.query(sql)
tdSql.query(sql)
tdSql.query("select 17-2.2 from stable_1;")
foriinrange(self.fornum):
...
...
@@ -1573,15 +1789,15 @@ class TDTestCase:
sql+=" from stable_1 t1, stable_2 t2 where t1.ts = t2.ts and "
sql+="%s "%random.choice(qt_u_or_where)
sql+="%s "%random.choice(interval_sliding)
sql+="%s "%random.choice(order_u_where)
#sql += "%s " % random.choice(order_u_where)
sql+="%s "%random.choice(limit_u_where)
sql+=") "
sql+="%s "%random.choice(interval_sliding)
#sql += "%s " % random.choice(interval_sliding)
tdLog.info(sql)
tdLog.info(len(sql))
# tdSql.error(sql)
tdSql.query(sql)
rsDn=self.restartDnodes()
self.restartDnodes()
tdSql.query("select 17-3 from stable_1;")
foriinrange(self.fornum):
#this is having_tagnot_support , because tag-select cannot mix with last_row...
...
...
@@ -1590,16 +1806,16 @@ class TDTestCase:
sql+="%s as cal17_2 "%random.choice(calc_aggregate_all)