Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f30df37e
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f30df37e
编写于
3月 21, 2023
作者:
H
Hui Li
提交者:
GitHub
3月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20531 from taosdata/test/TS-2908
test:add test case
上级
f97c4e7e
c35fc05d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
45 addition
and
1 deletion
+45
-1
tests/pytest/util/common.py
tests/pytest/util/common.py
+6
-0
tests/system-test/0-others/information_schema.py
tests/system-test/0-others/information_schema.py
+39
-1
未找到文件。
tests/pytest/util/common.py
浏览文件 @
f30df37e
...
...
@@ -739,6 +739,11 @@ class TDCom:
else
:
os
.
system
(
"unset LD_PRELOAD; pkill %s "
%
processorName
)
def
gen_tag_col_str
(
self
,
gen_type
,
data_type
,
count
):
"""
gen multi tags or cols by gen_type
"""
return
','
.
join
(
map
(
lambda
i
:
f
'
{
gen_type
}{
i
}
{
data_type
}
'
,
range
(
count
)))
def
is_json
(
msg
):
if
isinstance
(
msg
,
str
):
...
...
@@ -775,4 +780,5 @@ def dict2toml(in_dict: dict, file:str):
with
open
(
file
,
'w'
)
as
f
:
toml
.
dump
(
in_dict
,
f
)
tdCom
=
TDCom
()
tests/system-test/0-others/information_schema.py
浏览文件 @
f30df37e
...
...
@@ -93,7 +93,6 @@ class TDTestCase:
tdSql
.
checkEqual
(
i
[
2
],
len
(
self
.
perf_list
))
tdSql
.
execute
(
'create table db1.ntb (ts timestamp,c0 int)'
)
tdSql
.
query
(
f
'select db_name, count(*) from information_schema.ins_tables group by db_name'
)
print
(
tdSql
.
queryResult
)
for
i
in
tdSql
.
queryResult
:
if
i
[
0
].
lower
()
==
'information_schema'
:
tdSql
.
checkEqual
(
i
[
1
],
len
(
self
.
ins_list
))
...
...
@@ -101,6 +100,41 @@ class TDTestCase:
tdSql
.
checkEqual
(
i
[
1
],
len
(
self
.
perf_list
))
elif
i
[
0
].
lower
()
==
self
.
dbname
:
tdSql
.
checkEqual
(
i
[
1
],
self
.
tbnum
+
1
)
def
ins_col_check_4096
(
self
):
tdSql
.
execute
(
'create database db3 vgroups 2 replica 1'
)
col_str
=
tdCom
.
gen_tag_col_str
(
"col"
,
"int"
,
4094
)
tdSql
.
execute
(
f
'create stable if not exists db3.stb (col_ts timestamp,
{
col_str
}
) tags (t1 int)'
)
for
i
in
range
(
100
):
tdLog
.
info
(
f
"create table db3.ctb
{
i
}
using db3.stb tags(
{
i
}
)"
)
tdSql
.
execute
(
f
"create table db3.ctb
{
i
}
using db3.stb tags(
{
i
}
)"
)
col_value_str
=
'1, '
*
4093
+
'1'
tdSql
.
execute
(
f
"insert into db3.ctb
{
i
}
values(now,
{
col_value_str
}
)(now+1s,
{
col_value_str
}
)(now+2s,
{
col_value_str
}
)(now+3s,
{
col_value_str
}
)"
)
tdSql
.
query
(
"select * from information_schema.ins_columns"
)
tdSql
.
execute
(
'drop database db3'
)
def
ins_stable_check
(
self
):
tdSql
.
execute
(
'create database db3 vgroups 2 replica 1'
)
tbnum
=
10
ctbnum
=
10
for
i
in
range
(
tbnum
):
tdSql
.
execute
(
f
'create stable db3.stb_
{
i
}
(ts timestamp,c0 int) tags(t0 int)'
)
tdSql
.
execute
(
f
'create table db3.ntb_
{
i
}
(ts timestamp,c0 int)'
)
for
j
in
range
(
ctbnum
):
tdSql
.
execute
(
f
"create table db3.ctb_
{
i
}
_
{
j
}
using db3.stb_
{
i
}
tags(
{
j
}
)"
)
tdSql
.
query
(
"select stable_name,count(table_name) from information_schema.ins_tables where db_name = 'db3' group by stable_name order by stable_name"
)
result
=
tdSql
.
queryResult
for
i
in
range
(
len
(
result
)):
if
result
[
i
][
0
]
==
None
:
tdSql
.
checkEqual
(
result
[
0
][
1
],
tbnum
)
else
:
tdSql
.
checkEqual
(
result
[
i
][
0
],
f
'stb_
{
i
-
1
}
'
)
tdSql
.
checkEqual
(
result
[
i
][
1
],
ctbnum
)
def
ins_columns_check
(
self
):
tdSql
.
execute
(
'drop database if exists db2'
)
tdSql
.
execute
(
'create database if not exists db2 vgroups 1 replica 1'
)
...
...
@@ -129,10 +163,14 @@ class TDTestCase:
tdSql
.
query
(
f
'select * from information_schema.ins_columns where db_name="db2" and table_type=="NORMAL_TABLE"'
)
tdSql
.
checkEqual
(
20470
,
len
(
tdSql
.
queryResult
))
def
run
(
self
):
self
.
prepare_data
()
self
.
count_check
()
self
.
ins_columns_check
()
# self.ins_col_check_4096()
self
.
ins_stable_check
()
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录