Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9530fd01
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9530fd01
编写于
10月 27, 2022
作者:
H
Hui Li
提交者:
GitHub
10月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17687 from taosdata/test/fix_converage_enh
fix(coverage): enh function test case about cast , log , pow
上级
783b784c
ce19cfb9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
113 addition
and
0 deletion
+113
-0
tests/system-test/2-query/cast.py
tests/system-test/2-query/cast.py
+52
-0
tests/system-test/2-query/log.py
tests/system-test/2-query/log.py
+31
-0
tests/system-test/2-query/pow.py
tests/system-test/2-query/pow.py
+30
-0
未找到文件。
tests/system-test/2-query/cast.py
浏览文件 @
9530fd01
...
...
@@ -653,6 +653,58 @@ class TDTestCase:
tdSql.query(f"
select
cast
(
c9
as
timestamp
)
as
b
from
{
self
.
dbname
}
.
ct4
")
tdSql.query(f"
select
cast
(
c9
as
binary
(
64
)
)
as
b
from
{
self
.
dbname
}
.
ct4
")
# enh of cast function about coverage
tdSql.query(f"
select
cast
(
c1
as
int
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
bool
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
tinyint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
smallint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
float
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
double
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
tinyint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
smallint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c1
as
int
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c2
as
int
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c3
as
bool
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c4
as
tinyint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c5
as
smallint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c6
as
float
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c7
as
double
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c8
as
tinyint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c8
as
timestamp
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c9
as
timestamp
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c9
as
binary
(
64
)
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
abs
(
c2
)
as
int
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c3
as
bool
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
floor
(
c4
)
as
tinyint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c5
+
2
as
smallint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
2
as
float
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c7
as
double
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
'123'
as
tinyint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
max
(
cast
(
abs
(
c2
)
as
int
))
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
log
(
cast
(
c3
as
int
),
2
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
abs
(
cast
(
floor
(
c4
)
as
tinyint
))
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
last
(
cast
(
c5
+
2
as
smallint
))
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
mavg
(
cast
(
2
as
float
),
3
)
as
b
from
{
self
.
dbname
}
.
stb1
partition
by
tbname
")
tdSql.query(f"
select
cast
(
c7
as
double
)
as
b
from
{
self
.
dbname
}
.
stb1
partition
by
tbname
order
by
tbname
")
tdSql.query(f"
select
cast
(
'123'
as
tinyint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
partition
by
tbname
")
# uion with cast and common cols
tdSql.query(f"
select
cast
(
c2
as
int
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
c1
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c3
as
bool
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
c7
from
{
self
.
dbname
}
.
ct1
")
tdSql.query(f"
select
cast
(
c4
as
tinyint
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
c4
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c5
as
smallint
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
cast
(
c5
as
smallint
)
as
b
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c6
as
float
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
c5
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c7
as
double
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
123
from
{
self
.
dbname
}
.
stb1
")
tdSql.query(f"
select
cast
(
c8
as
tinyint
unsigned
)
as
b
from
{
self
.
dbname
}
.
stb1
union
all
select
last
(
cast
(
c8
as
tinyint
unsigned
))
from
{
self
.
dbname
}
.
stb1
")
def run(self):
tdSql.prepare()
...
...
tests/system-test/2-query/log.py
浏览文件 @
9530fd01
...
...
@@ -229,6 +229,36 @@ class TDTestCase:
tdSql
.
query
(
f
"select log(c6 ,2) from
{
dbname
}
.ct3"
)
tdSql
.
checkRows
(
0
)
# log used for different param types
tdSql
.
query
(
f
"select log(c1,c2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(c1,c2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(c1,2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(c1,2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(2,c2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(2,c2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(2,1) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(2,2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(2,floor(1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(2,floor(2)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(abs(2),floor(1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(abs(2),floor(2)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(abs(c2),c1) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(abs(c2),c1) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(c2,abs(c1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(c2,abs(c1)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select log(abs(c2),2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select log(abs(c2),2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
# # used for regular table
tdSql
.
query
(
f
"select log(c1 ,2) from
{
dbname
}
.t1"
)
...
...
@@ -292,6 +322,7 @@ class TDTestCase:
tdSql
.
checkRows
(
25
)
# used for not exists table
tdSql
.
error
(
f
"select log(c1, 2) from
{
dbname
}
.stbbb1"
)
tdSql
.
error
(
f
"select log(c1, 2) from
{
dbname
}
tbname"
)
...
...
tests/system-test/2-query/pow.py
浏览文件 @
9530fd01
...
...
@@ -216,6 +216,36 @@ class TDTestCase:
tdSql
.
checkRows
(
0
)
# pow used for different param types
tdSql
.
query
(
f
"select pow(c1,c2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(c1,c2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(c1,2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(c1,2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(2,c2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(2,c2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(2,1) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(2,2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(2,floor(1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(2,floor(2)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(abs(2),floor(1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(abs(2),floor(2)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(abs(c2),c1) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(abs(c2),c1) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(c2,abs(c1)) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(c2,abs(c1)) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
tdSql
.
query
(
f
"select pow(abs(c2),2) from
{
dbname
}
.ct1;"
)
tdSql
.
query
(
f
"select pow(abs(c2),2) from
{
dbname
}
.stb1 partition by tbname order by tbname;"
)
# # used for regular table
tdSql
.
query
(
f
"select pow(c1 ,2) from
{
dbname
}
.t1"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录