Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4fa21592
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4fa21592
编写于
10月 26, 2022
作者:
H
Hui Li
提交者:
GitHub
10月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17648 from taosdata/test/td-19853
test: add cases for TD-19853
上级
4f6045f0
e10e6443
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
15 deletion
+32
-15
tests/system-test/1-insert/block_wise.py
tests/system-test/1-insert/block_wise.py
+27
-13
tests/system-test/1-insert/time_range_wise.py
tests/system-test/1-insert/time_range_wise.py
+5
-2
未找到文件。
tests/system-test/1-insert/block_wise.py
浏览文件 @
4fa21592
...
...
@@ -298,7 +298,7 @@ class TDTestCase:
def
all_test
(
self
):
self
.
test_create_sma
()
def
__create_tb
(
self
):
def
__create_tb
(
self
,
rollup
=
None
):
tdLog
.
printNoPrefix
(
"==========step: create table"
)
create_stb_sql
=
f
'''create table
{
STBNAME
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
...
...
@@ -316,8 +316,12 @@ class TDTestCase:
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
)
'''
tdSql
.
execute
(
create_stb_sql
)
tdSql
.
execute
(
create_ntb_sql
)
if
rollup
is
not
None
:
create_stb_sql
+=
f
" rollup(
{
rollup
}
)"
tdSql
.
execute
(
create_stb_sql
)
else
:
tdSql
.
execute
(
create_stb_sql
)
tdSql
.
execute
(
create_ntb_sql
)
for
i
in
range
(
4
):
tdSql
.
execute
(
f
'create table ct
{
i
+
1
}
using stb1 tags (
{
i
+
1
}
)'
)
...
...
@@ -343,7 +347,7 @@ class TDTestCase:
return
data_set
def
__insert_data
(
self
):
def
__insert_data
(
self
,
rollup
=
None
):
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
data
=
self
.
__data_set
(
rows
=
self
.
rows
)
...
...
@@ -369,8 +373,9 @@ class TDTestCase:
f
"insert into ct2 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
0.6
)
}
,
{
neg_row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
0.8
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
if
rollup
is
None
:
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
+
int
(
TIME_STEP
*
0.6
)
}
,
{
null_data
}
)"
)
...
...
@@ -385,13 +390,13 @@ class TDTestCase:
f
"insert into ct4 values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
0.8
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.39
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
+
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.59
)
}
,
{
null_data
}
)"
)
if
rollup
is
None
:
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
+
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.59
)
}
,
{
null_data
}
)"
)
def
run
(
self
):
self
.
rows
=
10
...
...
@@ -421,6 +426,15 @@ class TDTestCase:
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
tdLog
.
printNoPrefix
(
"==========step3:insert and flush in rollup database"
)
tdSql
.
execute
(
"create database db4 retentions 1s:4m,2s:8m,3s:12m"
)
tdSql
.
execute
(
"use db4"
)
self
.
__create_tb
(
rollup
=
"first"
)
self
.
__insert_data
(
rollup
=
"first"
)
tdSql
.
execute
(
f
'drop stable if exists
{
STBNAME
}
'
)
tdSql
.
execute
(
f
'flush database db4'
)
tdLog
.
printNoPrefix
(
"==========step4:after wal, all check again "
)
tdSql
.
prepare
()
self
.
__create_tb
()
...
...
tests/system-test/1-insert/time_range_wise.py
浏览文件 @
4fa21592
...
...
@@ -565,15 +565,18 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
111
)
tdSql
.
execute
(
f
"flush database
{
DBNAME
}
"
)
tdLog
.
printNoPrefix
(
"==========step1.5 : drop index"
)
tdSql
.
execute
(
f
"drop index
{
DBNAME
}
.sma_index_name1"
)
tdLog
.
printNoPrefix
(
"==========step1.
5
: drop child table"
)
tdLog
.
printNoPrefix
(
"==========step1.
6
: drop child table"
)
tdSql
.
execute
(
f
"drop table
{
CTBNAME
}
"
)
tdSql
.
query
(
f
"select max(
{
INT_COL
}
), max(
{
BINT_COL
}
), min(
{
INT_COL
}
) from
{
DBNAME
}
.
{
STBNAME
}
interval(6m,10s) sliding(6m)"
)
tdSql
.
checkData
(
0
,
0
,
self
.
rows
-
1
)
tdSql
.
checkData
(
0
,
1
,
(
self
.
rows
-
1
)
*
2
)
tdSql
.
checkData
(
tdSql
.
queryRows
-
1
,
2
,
0
)
tdLog
.
printNoPrefix
(
"==========step1.
6
: drop stable"
)
tdLog
.
printNoPrefix
(
"==========step1.
7
: drop stable"
)
tdSql
.
execute
(
f
"drop table
{
STBNAME
}
"
)
tdSql
.
error
(
f
"select * from
{
DBNAME
}
.
{
STBNAME
}
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录