Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a95a5b10
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
a95a5b10
编写于
4月 28, 2022
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case
上级
0dfd9dc0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
21 deletion
+8
-21
tests/system-test/2-query/char_length.py
tests/system-test/2-query/char_length.py
+8
-6
tests/system-test/2-query/length.py
tests/system-test/2-query/length.py
+0
-15
未找到文件。
tests/system-test/2-query/char_length.py
浏览文件 @
a95a5b10
...
...
@@ -59,12 +59,14 @@ class TDTestCase:
groups
=
[
""
,
group_having
,
group_no_having
]
for
group_condition
in
groups
:
tdSql
.
query
(
f
"select
{
condition
}
from
{
tbname
}
{
where_condition
}
{
group_condition
}
"
)
datas
=
[
tdSql
.
getData
(
i
,
0
)
for
i
in
range
(
tdSql
.
queryRows
)]
char_length_data
=
[
len
(
str
(
data
))
if
data
else
None
for
data
in
datas
]
tdSql
.
query
(
f
"select char_length(
{
condition
}
) from
{
tbname
}
{
where_condition
}
{
group_condition
}
"
)
for
i
in
range
(
len
(
char_length_data
)):
tdSql
.
checkData
(
i
,
0
,
char_length_data
[
i
]
)
if
char_length_data
[
i
]
else
tdSql
.
checkData
(
i
,
0
,
None
)
tdSql
.
query
(
f
"select
{
condition
}
, length(
{
condition
}
) from
{
tbname
}
{
where_condition
}
{
group_condition
}
"
)
for
i
in
range
(
tdSql
.
queryRows
):
if
not
tdSql
.
getData
(
i
,
1
):
tdSql
.
checkData
(
i
,
1
,
None
)
# elif "as nchar" in condition or (NCHAR_COL in condition and "as binary" not in condition):
# tdSql.checkData(i, 1, len(str(tdSql.getData(i,0) ) ) * 4 )
else
:
tdSql
.
checkData
(
i
,
1
,
len
(
str
(
tdSql
.
getData
(
i
,
0
)
)
)
)
def
__char_length_err_check
(
self
,
tbname
):
sqls
=
[]
...
...
tests/system-test/2-query/length.py
浏览文件 @
a95a5b10
...
...
@@ -59,21 +59,6 @@ class TDTestCase:
groups
=
[
""
,
group_having
,
group_no_having
]
for
group_condition
in
groups
:
# tdSql.query(f"select {condition} from {tbname} {where_condition} {group_condition} ")
# datas = [tdSql.getData(i,0) for i in range(tdSql.queryRows)]
# # length_data = [ len(str(data)) if data else None for data in datas ]
# length_data = []
# for data in datas :
# if not data:
# length_data.append(None)
# elif "as nchar" in condition or (NCHAR_COL in condition and "as binary" not in condition):
# length_data.append(len(str(data)) * 4)
# else:
# length_data.append(len(str(data)))
# tdSql.query(f"select length( {condition} ) from {tbname} {where_condition} {group_condition}")
# for i in range(len(length_data)):
# tdSql.checkData(i, 0, length_data[i] ) if length_data[i] else tdSql.checkData(i, 0, None)
tdSql
.
query
(
f
"select
{
condition
}
, length(
{
condition
}
) from
{
tbname
}
{
where_condition
}
{
group_condition
}
"
)
for
i
in
range
(
tdSql
.
queryRows
):
if
not
tdSql
.
getData
(
i
,
1
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录