Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
bc5abd0f
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bc5abd0f
编写于
5月 14, 2020
作者:
S
Shuduo Sang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some test cases to test boundary which defined in inc/taosdef.h
[TD-221]
上级
36973a50
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
732 addition
and
0 deletion
+732
-0
tests/pytest/insert/binary-boundary.py
tests/pytest/insert/binary-boundary.py
+72
-0
tests/pytest/insert/nchar-boundary.py
tests/pytest/insert/nchar-boundary.py
+51
-0
tests/pytest/insert/nchar-unicode.py
tests/pytest/insert/nchar-unicode.py
+573
-0
tests/pytest/table/tablename-boundary.py
tests/pytest/table/tablename-boundary.py
+36
-0
未找到文件。
tests/pytest/insert/binary-boundary.py
0 → 100644
浏览文件 @
bc5abd0f
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
tdSql
.
prepare
()
tdLog
.
info
(
'=============== step1'
)
tdLog
.
info
(
'create table tb (ts timestamp, speed binary(4089))'
)
tdSql
.
error
(
'create table tb (ts timestamp, speed binary(4089))'
)
tdLog
.
info
(
'create table tb (ts timestamp, speed binary(4088))'
)
tdSql
.
error
(
'create table tb (ts timestamp, speed binary(4088))'
)
tdLog
.
info
(
'create table tb (ts timestamp, speed binary(4084))'
)
tdSql
.
execute
(
'create table tb (ts timestamp, speed binary(4084))'
)
tdLog
.
info
(
"insert into tb values (now, ) -x step1"
)
tdSql
.
error
(
"insert into tb values (now, )"
)
with
open
(
"../../README.md"
,
"r"
)
as
inputFile
:
data
=
inputFile
.
read
(
4084
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert %d length data: %s"
%
(
len
(
data
),
data
))
tdLog
.
info
(
"insert into tb values (now+2a, data)"
)
tdSql
.
execute
(
"insert into tb values (now+2a, '%s')"
%
data
)
tdLog
.
info
(
'select speed from tb order by ts desc'
)
tdSql
.
query
(
'select speed from tb order by ts desc'
)
tdLog
.
info
(
'tdSql.checkRow(1)'
)
tdSql
.
checkRows
(
1
)
tdLog
.
info
(
'==> $data01'
)
tdLog
.
info
(
"tdSql.checkData(0, 1, '%s')"
%
data
)
tdSql
.
checkData
(
0
,
1
,
data
)
tdLog
.
info
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
tdSql
.
execute
(
'create table tb2 (ts timestamp, speed binary(2040), temp binary(2044))'
)
speed
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert into tb values (now+3a, speed, temp)"
)
tdSql
.
error
(
"insert into tb values (now+3a, '%s', '%s')"
%
(
speed
,
temp
))
speed
=
inputFile
.
read
(
2040
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
temp
=
inputFile
.
read
(
2044
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert into tb values (now+4a, speed, temp)"
)
tdSql
.
error
(
"insert into tb values (now+4a, '%s', '%s')"
%
(
speed
,
temp
))
tdLog
.
info
(
'tdSql.checkRow(2)'
)
tdSql
.
checkRows
(
2
)
tdLog
.
info
(
'==> $data11'
)
tdLog
.
info
(
"tdSql.checkData(1, 1, '%s')"
%
speed
)
tdSql
.
checkData
(
1
,
1
,
speed
)
tdLog
.
info
(
'==> $data12'
)
tdLog
.
info
(
"tdSql.checkData(1, 2, '%s')"
%
temp
)
tdSql
.
checkData
(
1
,
1
,
temp
)
inputFile
.
close
()
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/insert/nchar-boundary.py
0 → 100644
浏览文件 @
bc5abd0f
###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or used in any form or by any means other than as
# expressly provided by the written permission from Jianhui Tao
#
###################################################################
# -*- coding: utf-8 -*-
import
sys
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
error
(
'create table tb (ts timestamp, col nchar(1022))'
)
tdSql
.
execute
(
'create table tb (ts timestamp, col nchar(1021))'
)
tdSql
.
execute
(
"insert into tb values (now, 'taosdata')"
)
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
1
,
'taosdata'
)
with
open
(
"../../README.md"
,
"r"
)
as
inputFile
:
data
=
inputFile
.
read
(
1021
).
replace
(
"
\n
"
,
" "
).
replace
(
"
\\
"
,
" "
).
replace
(
"
\'
"
,
" "
).
replace
(
"
\"
"
,
" "
).
replace
(
"["
,
" "
).
replace
(
"]"
,
" "
).
replace
(
"!"
,
" "
)
tdLog
.
info
(
"insert %d length data: %s"
%
(
len
(
data
),
data
))
tdSql
.
execute
(
"insert into tb values (now, '%s')"
%
data
)
tdSql
.
query
(
"select * from tb"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
1
,
1
,
data
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
tests/pytest/insert/nchar-unicode.py
0 → 100644
浏览文件 @
bc5abd0f
此差异已折叠。
点击以展开。
tests/pytest/table/tablename-boundary.py
0 → 100644
浏览文件 @
bc5abd0f
# -*- coding: utf-8 -*-
import
sys
import
string
import
random
from
util.log
import
*
from
util.cases
import
*
from
util.sql
import
*
class
TDTestCase
:
def
init
(
self
,
conn
):
tdLog
.
debug
(
"start to execute %s"
%
__file__
)
tdSql
.
init
(
conn
.
cursor
())
def
run
(
self
):
tdSql
.
prepare
()
chars
=
string
.
ascii_uppercase
+
string
.
ascii_lowercase
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
192
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
error
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
tb_name
=
''
.
join
(
random
.
choices
(
chars
,
k
=
191
))
tdLog
.
info
(
'tb_name length %d'
%
len
(
tb_name
))
tdLog
.
info
(
'create table %s (ts timestamp, value int)'
%
tb_name
)
tdSql
.
execute
(
'create table %s (ts timestamp, speed binary(4089))'
%
tb_name
)
def
stop
(
self
):
tdSql
.
close
()
tdLog
.
success
(
"%s successfully executed"
%
__file__
)
tdCases
.
addWindows
(
__file__
,
TDTestCase
())
tdCases
.
addLinux
(
__file__
,
TDTestCase
())
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录