Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
573c6e58
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
573c6e58
编写于
10月 20, 2022
作者:
haoranc
提交者:
GitHub
10月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update compatibility.py
上级
17e1d400
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
71 addition
and
71 deletion
+71
-71
tests/system-test/0-others/compatibility.py
tests/system-test/0-others/compatibility.py
+71
-71
未找到文件。
tests/system-test/0-others/compatibility.py
浏览文件 @
573c6e58
...
@@ -78,77 +78,77 @@ class TDTestCase:
...
@@ -78,77 +78,77 @@ class TDTestCase:
def
run
(
self
):
def
run
(
self
):
bPath
=
self
.
getBuildPath
()
bPath
=
self
.
getBuildPath
()
cPath
=
self
.
getCfgPath
()
cPath
=
self
.
getCfgPath
()
dbname
=
"test"
#
dbname = "test"
stb
=
f
"
{
dbname
}
.meters"
#
stb = f"{dbname}.meters"
self
.
installTaosd
(
bPath
,
cPath
)
#
self.installTaosd(bPath,cPath)
tableNumbers
=
100
#
tableNumbers=100
recordNumbers1
=
100
#
recordNumbers1=100
recordNumbers2
=
1000
#
recordNumbers2=1000
tdsqlF
=
tdCom
.
newTdSql
()
#
tdsqlF=tdCom.newTdSql()
print
(
tdsqlF
)
#
print(tdsqlF)
tdsqlF
.
query
(
f
"SELECT SERVER_VERSION();"
)
#
tdsqlF.query(f"SELECT SERVER_VERSION();")
print
(
tdsqlF
.
query
(
f
"SELECT SERVER_VERSION();"
))
#
print(tdsqlF.query(f"SELECT SERVER_VERSION();"))
oldServerVersion
=
tdsqlF
.
queryResult
[
0
][
0
]
#
oldServerVersion=tdsqlF.queryResult[0][0]
tdLog
.
info
(
f
"Base server version is
{
oldServerVersion
}
"
)
#
tdLog.info(f"Base server version is {oldServerVersion}")
tdsqlF
.
query
(
f
"SELECT CLIENT_VERSION();"
)
#
tdsqlF.query(f"SELECT CLIENT_VERSION();")
# the oldClientVersion can't be updated in the same python process,so the version is new compiled verison
#
# the oldClientVersion can't be updated in the same python process,so the version is new compiled verison
oldClientVersion
=
tdsqlF
.
queryResult
[
0
][
0
]
#
oldClientVersion=tdsqlF.queryResult[0][0]
tdLog
.
info
(
f
"Base client version is
{
oldClientVersion
}
"
)
#
tdLog.info(f"Base client version is {oldClientVersion}")
tdLog
.
printNoPrefix
(
f
"==========step1:prepare and check data in old version-
{
oldServerVersion
}
"
)
#
tdLog.printNoPrefix(f"==========step1:prepare and check data in old version-{oldServerVersion}")
tdLog
.
info
(
f
"taosBenchmark -t
{
tableNumbers
}
-n
{
recordNumbers1
}
-y "
)
#
tdLog.info(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
os
.
system
(
f
"taosBenchmark -t
{
tableNumbers
}
-n
{
recordNumbers1
}
-y "
)
#
os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers1} -y ")
sleep
(
3
)
#
sleep(3)
# tdsqlF.query(f"select count(*) from {stb}")
#
# tdsqlF.query(f"select count(*) from {stb}")
# tdsqlF.checkData(0,0,tableNumbers*recordNumbers1)
#
# tdsqlF.checkData(0,0,tableNumbers*recordNumbers1)
os
.
system
(
"pkill taosd"
)
#
os.system("pkill taosd")
sleep
(
1
)
#
sleep(1)
tdLog
.
printNoPrefix
(
"==========step2:update new version "
)
#
tdLog.printNoPrefix("==========step2:update new version ")
self
.
buildTaosd
(
bPath
)
#
self.buildTaosd(bPath)
tdDnodes
.
start
(
1
)
#
tdDnodes.start(1)
sleep
(
1
)
#
sleep(1)
tdsql
=
tdCom
.
newTdSql
()
#
tdsql=tdCom.newTdSql()
print
(
tdsql
)
#
print(tdsql)
tdsql
.
query
(
f
"SELECT SERVER_VERSION();"
)
#
tdsql.query(f"SELECT SERVER_VERSION();")
nowServerVersion
=
tdsql
.
queryResult
[
0
][
0
]
#
nowServerVersion=tdsql.queryResult[0][0]
tdLog
.
info
(
f
"New server version is
{
nowServerVersion
}
"
)
#
tdLog.info(f"New server version is {nowServerVersion}")
tdsql
.
query
(
f
"SELECT CLIENT_VERSION();"
)
#
tdsql.query(f"SELECT CLIENT_VERSION();")
nowClientVersion
=
tdsql
.
queryResult
[
0
][
0
]
#
nowClientVersion=tdsql.queryResult[0][0]
tdLog
.
info
(
f
"New client version is
{
nowClientVersion
}
"
)
#
tdLog.info(f"New client version is {nowClientVersion}")
tdLog
.
printNoPrefix
(
f
"==========step3:prepare and check data in new version-
{
nowServerVersion
}
"
)
#
tdLog.printNoPrefix(f"==========step3:prepare and check data in new version-{nowServerVersion}")
tdsql
.
query
(
f
"select count(*) from
{
stb
}
"
)
#
tdsql.query(f"select count(*) from {stb}")
tdsql
.
checkData
(
0
,
0
,
tableNumbers
*
recordNumbers1
)
#
tdsql.checkData(0,0,tableNumbers*recordNumbers1)
os
.
system
(
f
"taosBenchmark -t
{
tableNumbers
}
-n
{
recordNumbers2
}
-y "
)
#
os.system(f"taosBenchmark -t {tableNumbers} -n {recordNumbers2} -y ")
tdsql
.
query
(
f
"select count(*) from
{
stb
}
"
)
#
tdsql.query(f"select count(*) from {stb}")
tdsql
.
checkData
(
0
,
0
,
tableNumbers
*
recordNumbers2
)
#
tdsql.checkData(0,0,tableNumbers*recordNumbers2)
tdsql
=
tdCom
.
newTdSql
()
#
tdsql=tdCom.newTdSql()
tdLog
.
printNoPrefix
(
f
"==========step4:verify backticks in taos Sql-TD18542"
)
#
tdLog.printNoPrefix(f"==========step4:verify backticks in taos Sql-TD18542")
tdsql
.
execute
(
"drop database if exists db"
)
#
tdsql.execute("drop database if exists db")
tdsql
.
execute
(
"create database db"
)
#
tdsql.execute("create database db")
tdsql
.
execute
(
"use db"
)
#
tdsql.execute("use db")
tdsql
.
execute
(
"create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);"
)
#
tdsql.execute("create stable db.stb1 (ts timestamp, c1 int) tags (t1 int);")
tdsql
.
execute
(
"insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);"
)
#
tdsql.execute("insert into db.ct1 using db.stb1 TAGS(1) values(now(),11);")
tdsql
.
error
(
" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);"
)
#
tdsql.error(" insert into `db.ct2` using db.stb1 TAGS(9) values(now(),11);")
tdsql
.
error
(
" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);"
)
#
tdsql.error(" insert into db.`db.ct2` using db.stb1 TAGS(9) values(now(),11);")
tdsql
.
execute
(
"insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);"
)
#
tdsql.execute("insert into `db`.ct3 using db.stb1 TAGS(3) values(now(),13);")
tdsql
.
query
(
"select * from db.ct3"
)
#
tdsql.query("select * from db.ct3")
tdsql
.
checkData
(
0
,
1
,
13
)
#
tdsql.checkData(0,1,13)
tdsql
.
execute
(
"insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);"
)
#
tdsql.execute("insert into db.`ct4` using db.stb1 TAGS(4) values(now(),14);")
tdsql
.
query
(
"select * from db.ct4"
)
#
tdsql.query("select * from db.ct4")
tdsql
.
checkData
(
0
,
1
,
14
)
#
tdsql.checkData(0,1,14)
tdsql
.
query
(
"describe information_schema.ins_databases;"
)
#
tdsql.query("describe information_schema.ins_databases;")
qRows
=
tdsql
.
queryRows
#
qRows=tdsql.queryRows
for
i
in
range
(
qRows
)
:
#
for i in range(qRows) :
if
tdsql
.
queryResult
[
i
][
0
]
==
"retentions"
:
#
if tdsql.queryResult[i][0]=="retentions" :
return
True
#
return True
else
:
#
else:
return
False
#
return False
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
tdLog
.
success
(
f
"
{
__file__
}
successfully executed"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录