Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
36c693e1
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
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看板
提交
36c693e1
编写于
8月 17, 2021
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-6113] <fix> fix case of TD-6113
上级
a6df415b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
21 deletion
+25
-21
tests/pytest/query/distinctOneColTb.py
tests/pytest/query/distinctOneColTb.py
+25
-21
未找到文件。
tests/pytest/query/distinctOneColTb.py
浏览文件 @
36c693e1
...
...
@@ -47,10 +47,10 @@ class TDTestCase:
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct cbool from
{
sql
}
{
where
}
"
)
if
num
<
2
:
if
num
<
3
:
tdSql
.
checkRows
(
num
)
else
:
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
f
"select distinct cbinary from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
...
...
@@ -81,10 +81,10 @@ class TDTestCase:
tdSql
.
checkRows
(
num
)
tdSql
.
query
(
f
"select distinct cbool as a from
{
sql
}
{
where
}
"
)
if
num
<
2
:
if
num
<
3
:
tdSql
.
checkRows
(
num
)
else
:
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
f
"select distinct cbinary as a from
{
sql
}
{
where
}
"
)
tdSql
.
checkRows
(
num
)
...
...
@@ -147,11 +147,11 @@ class TDTestCase:
self
.
tb_all_query
(
num
=
inNum
,
where
=
"where cnchar in ('双','双精度浮')"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
inNum
,
where
=
"where cbool in (0, 1)"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"where cnchar like '双__浮'"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cnchar like '双%'"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cbinary like 'adc_'"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cbinary like 'a%'"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"limit 1"
,
sql
=
tbName
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"limit 1 offset 1"
,
sql
=
tbName
)
#
self.tb_all_query(num=maxNum,where="where cnchar like '双%'",sql=tbName)
#
self.tb_all_query(num=maxNum,where="where cbinary like 'adc_'",sql=tbName)
#
self.tb_all_query(num=maxNum,where="where cbinary like 'a%'",sql=tbName)
#
self.tb_all_query(num=whereNum,where="limit 1",sql=tbName)
#
self.tb_all_query(num=whereNum,where="limit 1 offset 1",sql=tbName)
#subquery
self
.
tb_all_query
(
num
=
maxNum
,
sql
=
f
'(select * from
{
tbName
}
)'
)
...
...
@@ -178,11 +178,11 @@ class TDTestCase:
self
.
tb_all_query
(
num
=
inNum
,
where
=
"where cnchar in ('双','双精度浮')"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
inNum
,
where
=
"where cbool in (0, 1)"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"where cnchar like '双__浮'"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cnchar like '双%'"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cbinary like 'adc_'"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
maxNum
,
where
=
"where cbinary like 'a%'"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"limit 1"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
self
.
tb_all_query
(
num
=
whereNum
,
where
=
"limit 1 offset 1"
,
sql
=
f
'(select * from
{
tbName
}
)'
)
#
self.tb_all_query(num=maxNum,where="where cnchar like '双%'",sql=f'(select * from {tbName})')
#
self.tb_all_query(num=maxNum,where="where cbinary like 'adc_'",sql=f'(select * from {tbName})')
#
self.tb_all_query(num=maxNum,where="where cbinary like 'a%'",sql=f'(select * from {tbName})')
#
self.tb_all_query(num=whereNum,where="limit 1",sql=f'(select * from {tbName})')
#
self.tb_all_query(num=whereNum,where="limit 1 offset 1",sql=f'(select * from {tbName})')
#table query with inner query has error
tdSql
.
error
(
'select distinct ts2 from (select )'
)
#table query with error option
...
...
@@ -195,8 +195,7 @@ class TDTestCase:
tdLog
.
notice
(
"==============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)"
)
tdSql
.
execute
(
"create table if not exists tb_all using stb_all tags(1)"
)
self
.
query_all_tb
()
tdLog
.
notice
(
...
...
@@ -212,11 +211,13 @@ class TDTestCase:
"insert into tb_all values(now,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)"
)
# normal query
self
.
query_all_tb
()
self
.
query_all_tb
(
maxNum
=
1
,
inNum
=
0
,
whereNum
=
0
)
tdLog
.
notice
(
"==============phase2 finished ==========
\n\n\n
"
)
tdLog
.
notice
(
"==============phase2 finished ==========
\n\n\n
"
)
tdSql
.
prepare
()
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)"
)
tdLog
.
notice
(
"==============phase3 distinct with distinct values ==========
\n\n\n
"
)
...
...
@@ -234,8 +235,11 @@ class TDTestCase:
# normal query
self
.
query_all_tb
(
maxNum
=
5
,
inNum
=
2
,
whereNum
=
1
)
tdLog
.
notice
(
"==============phase3 finishes ==========
\n\n\n
"
)
tdLog
.
notice
(
"==============phase3 finishes ==========
\n\n\n
"
)
tdSql
.
prepare
()
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)"
)
tdLog
.
notice
(
"==============phase4 distinct with some values the same values ==========
\n\n\n
"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录