Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
68ac4f97
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看板
提交
68ac4f97
编写于
10月 26, 2022
作者:
J
jiajingbin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: finish testcases for TD-19851
上级
3dc20e46
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
78 addition
and
0 deletion
+78
-0
tests/system-test/1-insert/tb_100w_data_order.py
tests/system-test/1-insert/tb_100w_data_order.py
+77
-0
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+1
-0
未找到文件。
tests/system-test/1-insert/tb_100w_data_order.py
0 → 100644
浏览文件 @
68ac4f97
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
from
util.common
import
*
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
self
.
ts
=
1537146000000
self
.
binary_str
=
'taosdata'
self
.
nchar_str
=
'涛思数据'
def
set_create_normaltable_sql
(
self
,
ntbname
,
column_dict
):
column_sql
=
''
for
k
,
v
in
column_dict
.
items
():
column_sql
+=
f
"
{
k
}
{
v
}
,"
create_ntb_sql
=
f
'create table
{
ntbname
}
(ts timestamp,
{
column_sql
[:
-
1
]
}
)'
return
create_ntb_sql
def
set_create_stable_sql
(
self
,
stbname
,
column_dict
,
tag_dict
):
column_sql
=
''
tag_sql
=
''
for
k
,
v
in
column_dict
.
items
():
column_sql
+=
f
"
{
k
}
{
v
}
,"
for
k
,
v
in
tag_dict
.
items
():
tag_sql
+=
f
"
{
k
}
{
v
}
,"
create_stb_sql
=
f
'create table
{
stbname
}
(ts timestamp,
{
column_sql
[:
-
1
]
}
) tags(
{
tag_sql
[:
-
1
]
}
)'
return
create_stb_sql
def
gen_batch_sql
(
self
,
ntbname
,
batch
=
10
):
values_str
=
""
for
i
in
range
(
batch
):
values_str
+=
f
'(
{
self
.
ts
}
, 1, 1, 1,
{
i
+
1
}
, 1, 1, 1,
{
i
+
1
}
,
{
i
+
0.1
}
,
{
i
+
0.1
}
,
{
i
%
2
}
,
{
i
+
1
}
,
{
i
+
1
}
),'
self
.
ts
+=
1
return
f
'insert into
{
ntbname
}
values
{
values_str
[:
-
1
]
}
;'
def
query_ntb_order_by_col
(
self
,
batch_num
,
rows_count
):
tdSql
.
prepare
()
ntbname
=
f
'db.
{
tdCom
.
getLongName
(
5
,
"letters"
)
}
'
column_dict
=
{
'col1'
:
'tinyint'
,
'col2'
:
'smallint'
,
'col3'
:
'int'
,
'col4'
:
'bigint'
,
'col5'
:
'tinyint unsigned'
,
'col6'
:
'smallint unsigned'
,
'col7'
:
'int unsigned'
,
'col8'
:
'bigint unsigned'
,
'col9'
:
'float'
,
'col10'
:
'double'
,
'col11'
:
'bool'
,
'col12'
:
'binary(20)'
,
'col13'
:
'nchar(20)'
}
range_times
=
int
(
rows_count
/
batch_num
)
create_ntb_sql
=
self
.
set_create_normaltable_sql
(
ntbname
,
column_dict
)
tdSql
.
execute
(
create_ntb_sql
)
for
i
in
range
(
range_times
):
tdSql
.
execute
(
self
.
gen_batch_sql
(
ntbname
,
batch_num
))
tdSql
.
query
(
f
'select count(*) from
{
ntbname
}
'
)
tdSql
.
checkEqual
(
tdSql
.
queryResult
[
0
][
0
],
rows_count
)
tdSql
.
query
(
f
'select * from
{
ntbname
}
order by col1'
)
tdSql
.
execute
(
f
'flush database db'
)
def
run
(
self
):
self
.
query_ntb_order_by_col
(
batch_num
=
1000
,
rows_count
=
1000000
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/system-test/fulltest.sh
浏览文件 @
68ac4f97
...
...
@@ -207,6 +207,7 @@ python3 ./test.py -f 2-query/varchar.py -R
python3 ./test.py
-f
1-insert/update_data.py
python3 ./test.py
-f
1-insert/tb_100w_data_order.py
python3 ./test.py
-f
1-insert/delete_data.py
python3 ./test.py
-f
1-insert/keep_expired.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录