fix: rename all queryResult name
This commit is contained in:
parent
00c8405fc9
commit
f7d7ce3515
|
@ -193,10 +193,10 @@ class TBase:
|
||||||
|
|
||||||
# sql
|
# sql
|
||||||
rows1 = tdSql.query(sql1,queryTimes=2)
|
rows1 = tdSql.query(sql1,queryTimes=2)
|
||||||
res1 = copy.deepcopy(tdSql.queryResult)
|
res1 = copy.deepcopy(tdSql.res)
|
||||||
|
|
||||||
tdSql.query(sql2,queryTimes=2)
|
tdSql.query(sql2,queryTimes=2)
|
||||||
res2 = tdSql.queryResult
|
res2 = tdSql.res
|
||||||
|
|
||||||
rowlen1 = len(res1)
|
rowlen1 = len(res1)
|
||||||
rowlen2 = len(res2)
|
rowlen2 = len(res2)
|
||||||
|
|
|
@ -795,7 +795,7 @@ class TDCom:
|
||||||
def getOneRow(self, location, containElm):
|
def getOneRow(self, location, containElm):
|
||||||
res_list = list()
|
res_list = list()
|
||||||
if 0 <= location < tdSql.queryRows:
|
if 0 <= location < tdSql.queryRows:
|
||||||
for row in tdSql.queryResult:
|
for row in tdSql.res:
|
||||||
if row[location] == containElm:
|
if row[location] == containElm:
|
||||||
res_list.append(row)
|
res_list.append(row)
|
||||||
return res_list
|
return res_list
|
||||||
|
@ -943,7 +943,7 @@ class TDCom:
|
||||||
"""drop all streams
|
"""drop all streams
|
||||||
"""
|
"""
|
||||||
tdSql.query("show streams")
|
tdSql.query("show streams")
|
||||||
stream_name_list = list(map(lambda x: x[0], tdSql.queryResult))
|
stream_name_list = list(map(lambda x: x[0], tdSql.res))
|
||||||
for stream_name in stream_name_list:
|
for stream_name in stream_name_list:
|
||||||
tdSql.execute(f'drop stream if exists {stream_name};')
|
tdSql.execute(f'drop stream if exists {stream_name};')
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ class TDCom:
|
||||||
"""drop all databases
|
"""drop all databases
|
||||||
"""
|
"""
|
||||||
tdSql.query("show databases;")
|
tdSql.query("show databases;")
|
||||||
db_list = list(map(lambda x: x[0], tdSql.queryResult))
|
db_list = list(map(lambda x: x[0], tdSql.res))
|
||||||
for dbname in db_list:
|
for dbname in db_list:
|
||||||
if dbname not in self.white_list and "telegraf" not in dbname:
|
if dbname not in self.white_list and "telegraf" not in dbname:
|
||||||
tdSql.execute(f'drop database if exists `{dbname}`')
|
tdSql.execute(f'drop database if exists `{dbname}`')
|
||||||
|
@ -1412,7 +1412,7 @@ class TDCom:
|
||||||
input_function (str): scalar
|
input_function (str): scalar
|
||||||
"""
|
"""
|
||||||
tdSql.query(sql)
|
tdSql.query(sql)
|
||||||
res = tdSql.queryResult
|
res = tdSql.res
|
||||||
if input_function in ["acos", "asin", "atan", "cos", "log", "pow", "sin", "sqrt", "tan"]:
|
if input_function in ["acos", "asin", "atan", "cos", "log", "pow", "sin", "sqrt", "tan"]:
|
||||||
tdSql.checkEqual(res[1][1], "DOUBLE")
|
tdSql.checkEqual(res[1][1], "DOUBLE")
|
||||||
tdSql.checkEqual(res[2][1], "DOUBLE")
|
tdSql.checkEqual(res[2][1], "DOUBLE")
|
||||||
|
@ -1490,7 +1490,7 @@ class TDCom:
|
||||||
bigint: bigint-ts
|
bigint: bigint-ts
|
||||||
"""
|
"""
|
||||||
tdSql.query(f'select cast({str_ts} as bigint)')
|
tdSql.query(f'select cast({str_ts} as bigint)')
|
||||||
return tdSql.queryResult[0][0]
|
return tdSql.res[0][0]
|
||||||
|
|
||||||
def cast_query_data(self, query_data):
|
def cast_query_data(self, query_data):
|
||||||
"""cast query-result for existed-stb
|
"""cast query-result for existed-stb
|
||||||
|
@ -1514,7 +1514,7 @@ class TDCom:
|
||||||
tdSql.query(f'select cast("{v}" as binary(6))')
|
tdSql.query(f'select cast("{v}" as binary(6))')
|
||||||
else:
|
else:
|
||||||
tdSql.query(f'select cast("{v}" as {" ".join(col_tag_type_list[i].strip().split(" ")[1:])})')
|
tdSql.query(f'select cast("{v}" as {" ".join(col_tag_type_list[i].strip().split(" ")[1:])})')
|
||||||
query_data_l[i] = tdSql.queryResult[0][0]
|
query_data_l[i] = tdSql.res[0][0]
|
||||||
else:
|
else:
|
||||||
query_data_l[i] = v
|
query_data_l[i] = v
|
||||||
nl.append(tuple(query_data_l))
|
nl.append(tuple(query_data_l))
|
||||||
|
@ -1566,9 +1566,9 @@ class TDCom:
|
||||||
if tag_value_list:
|
if tag_value_list:
|
||||||
dvalue = len(self.tag_type_str.split(',')) - defined_tag_count
|
dvalue = len(self.tag_type_str.split(',')) - defined_tag_count
|
||||||
tdSql.query(sql1)
|
tdSql.query(sql1)
|
||||||
res1 = tdSql.queryResult
|
res1 = tdSql.res
|
||||||
tdSql.query(sql2)
|
tdSql.query(sql2)
|
||||||
res2 = self.cast_query_data(tdSql.queryResult) if tag_value_list or use_exist_stb else tdSql.queryResult
|
res2 = self.cast_query_data(tdSql.res) if tag_value_list or use_exist_stb else tdSql.res
|
||||||
tdSql.sql = sql1
|
tdSql.sql = sql1
|
||||||
new_list = list()
|
new_list = list()
|
||||||
if tag_value_list:
|
if tag_value_list:
|
||||||
|
@ -1601,10 +1601,10 @@ class TDCom:
|
||||||
tdLog.info("query retrying ...")
|
tdLog.info("query retrying ...")
|
||||||
new_list = list()
|
new_list = list()
|
||||||
tdSql.query(sql1)
|
tdSql.query(sql1)
|
||||||
res1 = tdSql.queryResult
|
res1 = tdSql.res
|
||||||
tdSql.query(sql2)
|
tdSql.query(sql2)
|
||||||
# res2 = tdSql.queryResult
|
# res2 = tdSql.res
|
||||||
res2 = self.cast_query_data(tdSql.queryResult) if tag_value_list or use_exist_stb else tdSql.queryResult
|
res2 = self.cast_query_data(tdSql.res) if tag_value_list or use_exist_stb else tdSql.res
|
||||||
tdSql.sql = sql1
|
tdSql.sql = sql1
|
||||||
|
|
||||||
if tag_value_list:
|
if tag_value_list:
|
||||||
|
@ -1643,10 +1643,10 @@ class TDCom:
|
||||||
tdLog.info("query retrying ...")
|
tdLog.info("query retrying ...")
|
||||||
new_list = list()
|
new_list = list()
|
||||||
tdSql.query(sql1)
|
tdSql.query(sql1)
|
||||||
res1 = tdSql.queryResult
|
res1 = tdSql.res
|
||||||
tdSql.query(sql2)
|
tdSql.query(sql2)
|
||||||
# res2 = tdSql.queryResult
|
# res2 = tdSql.res
|
||||||
res2 = self.cast_query_data(tdSql.queryResult) if tag_value_list or use_exist_stb else tdSql.queryResult
|
res2 = self.cast_query_data(tdSql.res) if tag_value_list or use_exist_stb else tdSql.res
|
||||||
tdSql.sql = sql1
|
tdSql.sql = sql1
|
||||||
|
|
||||||
if tag_value_list:
|
if tag_value_list:
|
||||||
|
|
|
@ -86,10 +86,9 @@ class ConfigureyCluster:
|
||||||
count=0
|
count=0
|
||||||
while count < 5:
|
while count < 5:
|
||||||
tdSql.query("select * from information_schema.ins_dnodes")
|
tdSql.query("select * from information_schema.ins_dnodes")
|
||||||
# tdLog.debug(tdSql.queryResult)
|
|
||||||
status=0
|
status=0
|
||||||
for i in range(self.dnodeNums):
|
for i in range(self.dnodeNums):
|
||||||
if tdSql.queryResult[i][4] == "ready":
|
if tdSql.res[i][4] == "ready":
|
||||||
status+=1
|
status+=1
|
||||||
# tdLog.debug(status)
|
# tdLog.debug(status)
|
||||||
|
|
||||||
|
|
|
@ -560,17 +560,6 @@ if __name__ == "__main__":
|
||||||
conn = taosws.connect(f"taosws://root:taosdata@{host}:6041")
|
conn = taosws.connect(f"taosws://root:taosdata@{host}:6041")
|
||||||
else:
|
else:
|
||||||
conn = taos.connect(host=f"{host}", config=tdDnodes.getSimCfgPath())
|
conn = taos.connect(host=f"{host}", config=tdDnodes.getSimCfgPath())
|
||||||
# tdSql.init(conn.cursor())
|
|
||||||
# tdSql.execute("create qnode on dnode 1")
|
|
||||||
# tdSql.execute('alter local "queryPolicy" "%d"'%queryPolicy)
|
|
||||||
# tdSql.query("show local variables;")
|
|
||||||
# for i in range(tdSql.queryRows):
|
|
||||||
# if tdSql.queryResult[i][0] == "queryPolicy" :
|
|
||||||
# if int(tdSql.queryResult[i][1]) == int(queryPolicy):
|
|
||||||
# tdLog.info('alter queryPolicy to %d successfully'%queryPolicy)
|
|
||||||
# else :
|
|
||||||
# tdLog.debug(tdSql.queryResult)
|
|
||||||
# tdLog.exit("alter queryPolicy to %d failed"%queryPolicy)
|
|
||||||
|
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
cursor.execute("create qnode on dnode 1")
|
cursor.execute("create qnode on dnode 1")
|
||||||
|
|
Loading…
Reference in New Issue