Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Tonvia
TDengine
提交
93eecb6c
T
TDengine
项目概览
Tonvia
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93eecb6c
编写于
8月 13, 2021
作者:
B
bryanchang0603
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-5722]<test> removing bracket as it may cause error in the future
上级
708216e6
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
24 addition
and
39 deletion
+24
-39
tests/pytest/query/distinctOneColTb.py
tests/pytest/query/distinctOneColTb.py
+24
-39
未找到文件。
tests/pytest/query/distinctOneColTb.py
浏览文件 @
93eecb6c
...
...
@@ -25,116 +25,101 @@ class TDTestCase:
def
tb_all_query
(
self
,
num
,
sql
=
"tb_all"
,
where
=
""
):
tdSql
.
query
(
f
"select distinct
(ts2)
from
{
sql
}
{
where
}
"
)
f
"select distinct
ts2
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cint)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cint
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cbigint)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cbigint
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(csmallint)
from
{
sql
}
{
where
}
"
)
f
"select distinct
csmallint
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(ctinyint)
from
{
sql
}
{
where
}
"
)
f
"select distinct
ctinyint
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cfloat)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cfloat
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cdouble)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cdouble
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cbool)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cbool
from
{
sql
}
{
where
}
"
)
if
num
<
2
:
tdSql
.
checkRows
(
num
)
else
:
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
f
"select distinct
(cbinary)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cbinary
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cnchar)
from
{
sql
}
{
where
}
"
)
f
"select distinct
cnchar
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(ts2)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
ts2
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cint)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cint
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cbigint)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cbigint
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(csmallint)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
csmallint
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(ctinyint)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
ctinyint
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cfloat)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cfloat
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cdouble)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cdouble
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cbool)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cbool
as a from
{
sql
}
{
where
}
"
)
if
num
<
2
:
tdSql
.
checkRows
(
num
)
else
:
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
f
"select distinct
(cbinary)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cbinary
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct
(cnchar)
as a from
{
sql
}
{
where
}
"
)
f
"select distinct
cnchar
as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
def
tb_all_query_sub
(
self
,
num
,
sql
=
"tb_all"
,
where
=
""
,
colName
=
"c1"
):
tdSql
.
query
(
f
"select distinct
(
{
colName
}
)
from
{
sql
}
{
where
}
"
)
f
"select distinct
{
colName
}
from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
def
errorCheck
(
self
,
sql
=
'tb_all'
):
tdSql
.
error
(
f
"select distinct() from
{
sql
}
"
)
tdSql
.
error
(
f
"select distinct from
{
sql
}
"
)
tdSql
.
error
(
f
"distinct ts2 from
{
sql
}
"
)
tdSql
.
error
(
f
"distinct(ts2) from
{
sql
}
"
)
tdSql
.
error
(
f
"distinct c1 from"
)
tdSql
.
error
(
f
"distinct(c1) from"
)
tdSql
.
error
(
f
"select distinct(ts2), avg(cint) from
{
sql
}
"
)
tdSql
.
error
(
f
"select distinct ts2, avg(cint) from
{
sql
}
"
)
## the following line is going to core dump
#tdSql.error(f"select avg(cint), distinct(ts2) from {sql}")
#tdSql.error(f"select avg(cint), distinct ts2 from {sql}")
tdSql
.
error
(
f
"select distinct(ts2), cint from
{
sql
}
"
)
tdSql
.
error
(
f
"select distinct ts2, cint from
{
sql
}
"
)
tdSql
.
error
(
f
"select distinct(ts2) from
{
sql
}
group by cint"
)
tdSql
.
error
(
f
"select distinct ts2 from
{
sql
}
group by cint"
)
tdSql
.
error
(
f
"select distinct(ts2) from
{
sql
}
intervasl(1s)"
)
tdSql
.
error
(
f
"select distinct ts2 from
{
sql
}
interval(1s)"
)
tdSql
.
error
(
f
"select distinct(ts2) from
{
sql
}
slimit 1 soffset 1"
)
tdSql
.
error
(
f
"select distinct ts2 from
{
sql
}
slimit 1 soffset 1"
)
tdSql
.
error
(
f
"select distinct(ts2) from
{
sql
}
slimit 1"
)
tdSql
.
error
(
f
"select distinct ts2 from
{
sql
}
slimit 1"
)
##order by is not supported but not being prohibited
#tdSql.error(f"select distinct(ts2) from {sql} order by desc")
#tdSql.error(f"select distinct ts2 from {sql} order by desc")
#tdSql.error(f"select distinct(ts2) from {sql} order by asc")
#tdSql.error(f"select distinct ts2 from {sql} order by asc")
##distinct should not use on first ts, but it can be applied
#tdSql.error(f"select distinct(ts) from {sql}")
#tdSql.error(f"select distinct ts from {sql}")
##distinct should not be used in inner query, but error did not occur
# tdSql.error(f"select distinct(ts2) from (select distinct ts2 from {sql})")
# tdSql.error(f"select distinct ts2 from (select distinct ts2 from {sql})")
...
...
@@ -208,7 +193,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdLog
.
notice
(
"==============phase1 distinct
(col1)
with no values=========="
)
"==============phase1 distinct
col1
with no values=========="
)
tdSql
.
execute
(
"create stable if not exists stb_all (ts timestamp, ts2 timestamp, cint int, cbigint bigint, csmallint smallint, ctinyint tinyint,cfloat float, cdouble double, cbool bool, cbinary binary(32), cnchar nchar(32)) tags(tint int)"
)
tdSql
.
execute
(
"create table if not exists tb_all using stb_all tags(1)"
)
...
...
@@ -218,7 +203,7 @@ class TDTestCase:
"==============phase1 finished ==========
\n\n\n
"
)
tdLog
.
notice
(
"==============phase2 distinct
(col1)
all values are null=========="
)
"==============phase2 distinct
col1
all values are null=========="
)
tdSql
.
execute
(
"insert into tb_all values(now,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)"
)
tdSql
.
execute
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录