Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
aab9c55d
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看板
提交
aab9c55d
编写于
5月 09, 2022
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case
上级
a08fdbb4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
22 deletion
+25
-22
tests/system-test/2-query/cast.py
tests/system-test/2-query/cast.py
+17
-17
tests/system-test/2-query/char_length.py
tests/system-test/2-query/char_length.py
+5
-5
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+3
-0
未找到文件。
tests/system-test/2-query/cast.py
浏览文件 @
aab9c55d
...
...
@@ -20,7 +20,7 @@ class TDTestCase:
__sql
=
f
"select cast(
{
col_name
}
as bigint),
{
col_name
}
from
{
tbname
}
"
tdSql
.
query
(
sql
=
__sql
)
data_tb_col
=
[
result
[
1
]
for
result
in
tdSql
.
queryResult
]
for
i
in
range
(
len
(
tdSql
.
queryRows
)
):
for
i
in
range
(
tdSql
.
queryRows
):
tdSql
.
checkData
(
i
,
0
,
None
)
if
data_tb_col
[
i
]
is
None
else
tdSql
.
checkData
(
i
,
0
,
int
(
data_tb_col
[
i
])
)
def
__range_to_bigint
(
self
,
cols
,
tables
):
...
...
@@ -32,7 +32,7 @@ class TDTestCase:
__sql
=
f
"select cast(
{
col_name
}
as timestamp),
{
col_name
}
from
{
tbname
}
"
tdSql
.
query
(
sql
=
__sql
)
data_tb_col
=
[
result
[
1
]
for
result
in
tdSql
.
queryResult
]
for
i
in
range
(
len
(
tdSql
.
queryRows
)
):
for
i
in
range
(
tdSql
.
queryRows
):
if
data_tb_col
[
i
]
is
None
:
tdSql
.
checkData
(
i
,
0
,
None
)
if
col_name
not
in
[
"c2"
,
"double"
]
or
tbname
!=
"t1"
or
i
!=
10
:
...
...
@@ -597,37 +597,37 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step39: cast constant operation to bigint, expect change to int "
)
tdSql
.
query
(
"select cast(12121.23323131 as bigint) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
12121
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
12121
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 as binary(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 as binary(2)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 as nchar(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 as nchar(2)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 321.876897998 as bigint) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
12443
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
12443
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 321.876897998 as binary(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12443.110129'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12443.110129'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 321.876897998 as binary(3)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'124'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'124'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 321.876897998 as nchar(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12443.110129'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12443.110129'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 321.876897998 as nchar(3)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'124'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'124'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as bigint) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
12121
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
12121
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as binary(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as binary(2)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as nchar(16)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12121.233231'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdSql
.
query
(
"select cast(12121.23323131 + 'test~!@`#$%^&*()}{][;><.,' as nchar(2)) as b from ct4"
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
len
(
tdSql
.
queryRows
)
)
)
(
tdSql
.
checkData
(
i
,
0
,
'12'
)
for
i
in
range
(
tdSql
.
queryRows
)
)
tdLog
.
printNoPrefix
(
"==========step40: error cast condition, should return error "
)
tdSql
.
error
(
"select cast(c1 as int) as b from ct4"
)
...
...
tests/system-test/2-query/char_length.py
浏览文件 @
aab9c55d
...
...
@@ -232,13 +232,13 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"==========step3:all check"
)
self
.
all_test
()
#
tdDnodes.stop(1)
#
tdDnodes.start(1)
tdDnodes
.
stop
(
1
)
tdDnodes
.
start
(
1
)
#
tdSql.execute("use db")
tdSql
.
execute
(
"use db"
)
#
tdLog.printNoPrefix("==========step4:after wal, all check again ")
#
self.all_test()
tdLog
.
printNoPrefix
(
"==========step4:after wal, all check again "
)
self
.
all_test
()
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/system-test/fulltest.sh
浏览文件 @
aab9c55d
...
...
@@ -14,6 +14,9 @@ python3 ./test.py -f 2-query/varchar.py
python3 ./test.py
-f
2-query/ltrim.py
python3 ./test.py
-f
2-query/rtrim.py
python3 ./test.py
-f
2-query/length.py
python3 ./test.py
-f
2-query/char_length.py
python3 ./test.py
-f
2-query/upper.py
python3 ./test.py
-f
2-query/lower.py
python3 ./test.py
-f
2-query/timezone.py
python3 ./test.py
-f
2-query/Now.py
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录