Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
34d6383a
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
34d6383a
编写于
5月 27, 2021
作者:
P
Ping Xiao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-4122]<test>: add test case
上级
2d0b0558
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
58 addition
and
6 deletion
+58
-6
tests/pytest/fulltest.sh
tests/pytest/fulltest.sh
+1
-1
tests/pytest/table/tablename-boundary.py
tests/pytest/table/tablename-boundary.py
+57
-5
未找到文件。
tests/pytest/fulltest.sh
浏览文件 @
34d6383a
...
@@ -31,7 +31,7 @@ python3 ./test.py -f table/column_name.py
...
@@ -31,7 +31,7 @@ python3 ./test.py -f table/column_name.py
python3 ./test.py
-f
table/column_num.py
python3 ./test.py
-f
table/column_num.py
python3 ./test.py
-f
table/db_table.py
python3 ./test.py
-f
table/db_table.py
python3 ./test.py
-f
table/create_sensitive.py
python3 ./test.py
-f
table/create_sensitive.py
#
python3 ./test.py -f table/tablename-boundary.py
python3 ./test.py
-f
table/tablename-boundary.py
python3 ./test.py
-f
table/max_table_length.py
python3 ./test.py
-f
table/max_table_length.py
python3 ./test.py
-f
table/alter_column.py
python3 ./test.py
-f
table/alter_column.py
python3 ./test.py
-f
table/boundary.py
python3 ./test.py
-f
table/boundary.py
...
...
tests/pytest/table/tablename-boundary.py
浏览文件 @
34d6383a
...
@@ -14,6 +14,13 @@ class TDTestCase:
...
@@ -14,6 +14,13 @@ class TDTestCase:
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
tdSql
.
init
(
conn
.
cursor
(),
logSql
)
self
.
ts
=
1622100000000
def
get_random_string
(
self
,
length
):
letters
=
string
.
ascii_lowercase
result_str
=
''
.
join
(
random
.
choice
(
letters
)
for
i
in
range
(
length
))
return
result_str
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
...
@@ -24,19 +31,64 @@ class TDTestCase:
...
@@ -24,19 +31,64 @@ class TDTestCase:
shell
=
True
))
-
1
shell
=
True
))
-
1
tdLog
.
info
(
"table name max length is %d"
%
tableNameMaxLen
)
tdLog
.
info
(
"table name max length is %d"
%
tableNameMaxLen
)
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
tableNameMaxLen
))
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
tableNameMaxLen
+
1
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
error
(
tdSql
.
error
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
191
))
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
tableNameMaxLen
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
execute
(
tdSql
.
execute
(
'create table %s (ts timestamp, speed binary(4089))'
%
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tb_name
)
db_name
=
self
.
get_random_string
(
33
)
tdSql
.
error
(
"create database %s"
%
db_name
)
db_name
=
self
.
get_random_string
(
32
)
tdSql
.
execute
(
"create database %s"
%
db_name
)
tdSql
.
execute
(
"use %s"
%
db_name
)
tb_name
=
self
.
get_random_string
(
193
)
tdSql
.
error
(
"create table %s(ts timestamp, val int)"
%
tb_name
)
tb_name
=
self
.
get_random_string
(
192
)
tdSql
.
execute
(
"create table %s.%s(ts timestamp, val int)"
%
(
db_name
,
tb_name
))
tdSql
.
query
(
"show %s.tables"
%
db_name
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
tb_name
)
tdSql
.
execute
(
"insert into %s.%s values(now, 1)"
%
(
db_name
,
tb_name
))
tdSql
.
query
(
"select * from %s.%s"
%
(
db_name
,
tb_name
))
tdSql
.
checkRows
(
1
)
db_name
=
self
.
get_random_string
(
32
)
tdSql
.
execute
(
"create database %s update 1"
%
db_name
)
stb_name
=
self
.
get_random_string
(
192
)
tdSql
.
execute
(
"create table %s.%s(ts timestamp, val int) tags(id int)"
%
(
db_name
,
stb_name
))
tb_name1
=
self
.
get_random_string
(
192
)
tdSql
.
execute
(
"insert into %s.%s using %s.%s tags(1) values(%d, 1)(%d, 2)(%d, 3)"
%
(
db_name
,
tb_name1
,
db_name
,
stb_name
,
self
.
ts
,
self
.
ts
+
1
,
self
.
ts
+
2
))
tb_name2
=
self
.
get_random_string
(
192
)
tdSql
.
execute
(
"insert into %s.%s using %s.%s tags(2) values(%d, 1)(%d, 2)(%d, 3)"
%
(
db_name
,
tb_name2
,
db_name
,
stb_name
,
self
.
ts
,
self
.
ts
+
1
,
self
.
ts
+
2
))
tdSql
.
query
(
"show %s.tables"
%
db_name
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
0
,
tb_name1
)
tdSql
.
checkData
(
1
,
0
,
tb_name2
)
tdSql
.
query
(
"select * from %s.%s"
%
(
db_name
,
stb_name
))
tdSql
.
checkRows
(
6
)
tdSql
.
execute
(
"insert into %s.%s using %s.%s tags(1) values(%d, null)"
%
(
db_name
,
tb_name1
,
db_name
,
stb_name
,
self
.
ts
))
tdSql
.
query
(
"select * from %s.%s"
%
(
db_name
,
stb_name
))
tdSql
.
checkRows
(
6
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录