Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
83fcf4fd
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看板
未验证
提交
83fcf4fd
编写于
9月 19, 2022
作者:
W
wade zhang
提交者:
GitHub
9月 19, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #16881 from taosdata/3.0test/jcy
test:add test case for param ttl
上级
e2f9a4c5
838ab9bd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
15 deletion
+27
-15
tests/system-test/1-insert/table_param_ttl.py
tests/system-test/1-insert/table_param_ttl.py
+26
-14
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-1
未找到文件。
tests/system-test/1-insert/table_param_ttl.py
浏览文件 @
83fcf4fd
...
...
@@ -31,45 +31,57 @@ class TDTestCase:
tdSql
.
prepare
()
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
ntbname
}
_
{
i
}
(ts timestamp,c0 int) ttl
{
self
.
default_ttl
}
'
)
for
i
in
range
(
int
(
self
.
tbnum
/
2
)):
tdSql
.
execute
(
f
'alter table
{
self
.
ntbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
tdSql
.
execute
(
f
'alter table
db.
{
self
.
ntbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
modify_ttl
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
-
int
(
self
.
tbnum
/
2
))
tdSql
.
execute
(
'drop database db'
)
def
ttl_check_ctb
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'create table
{
self
.
stbname
}
_
{
i
}
using
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
query
(
f
'show tables'
)
tdSql
.
execute
(
f
'create table
db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
default_ttl
}
'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
for
i
in
range
(
int
(
self
.
tbnum
/
2
)):
tdSql
.
execute
(
f
'alter table
{
self
.
stbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
tdSql
.
execute
(
f
'alter table
db.
{
self
.
stbname
}
_
{
i
}
ttl
{
self
.
modify_ttl
}
'
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
modify_ttl
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show tables'
)
tdSql
.
query
(
f
'show
db.
tables'
)
tdSql
.
checkRows
(
self
.
tbnum
-
int
(
self
.
tbnum
/
2
))
tdSql
.
execute
(
'drop database db'
)
def
ttl_check_insert
(
self
):
tdSql
.
prepare
()
tdSql
.
execute
(
f
'create table db.
{
self
.
stbname
}
(ts timestamp,c0 int) tags(t0 int)'
)
for
i
in
range
(
self
.
tbnum
):
tdSql
.
execute
(
f
'insert into db.
{
self
.
stbname
}
_
{
i
}
using db.
{
self
.
stbname
}
tags(
{
i
}
) ttl
{
self
.
ttl_param
}
values(now,1)'
)
tdSql
.
query
(
f
'show db.tables'
)
tdSql
.
checkRows
(
self
.
tbnum
)
sleep
(
self
.
updatecfgDict
[
'ttlUnit'
]
*
self
.
ttl_param
+
self
.
updatecfgDict
[
'ttlPushInterval'
])
tdSql
.
query
(
f
'show db.tables'
)
tdSql
.
checkRows
(
0
)
tdSql
.
execute
(
'drop database db'
)
def
run
(
self
):
self
.
ttl_check_ntb
()
self
.
ttl_check_ctb
()
self
.
ttl_check_insert
()
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
83fcf4fd
...
...
@@ -32,7 +32,7 @@ python3 ./test.py -f 1-insert/block_wise.py
python3 ./test.py
-f
1-insert/create_retentions.py
python3 ./test.py
-f
1-insert/table_param_ttl.py
python3 ./test.py
-f
1-insert/mutil_stage.py
python3 ./test.py
-f
1-insert/table_param_ttl.py
-R
python3 ./test.py
-f
1-insert/update_data_muti_rows.py
python3 ./test.py
-f
1-insert/db_tb_name_check.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录