Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
71badf8c
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
71badf8c
编写于
4月 01, 2021
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix filter error
上级
a5b4ae69
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
76 addition
and
22 deletion
+76
-22
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+3
-1
tests/script/general/parser/having_child.sim
tests/script/general/parser/having_child.sim
+73
-21
未找到文件。
src/query/src/qExecutor.c
浏览文件 @
71badf8c
...
@@ -4709,7 +4709,7 @@ void doHavingImpl(SOperatorInfo *pOperator, SSDataBlock *pBlock) {
...
@@ -4709,7 +4709,7 @@ void doHavingImpl(SOperatorInfo *pOperator, SSDataBlock *pBlock) {
//SColIndex* colIdx = &pExprInfo->base.colInfo;
//SColIndex* colIdx = &pExprInfo->base.colInfo;
SColumnInfoData
*
p
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnInfoData
*
p
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnFilterElem
filterElem
=
{.
filterInfo
=
*
pExprInfo
->
pFilter
};
SColumnFilterElem
filterElem
=
{.
filterInfo
=
pExprInfo
->
pFilter
[
m
]
};
if
(
doFilterData
(
p
,
r
,
&
filterElem
,
fp
))
{
if
(
doFilterData
(
p
,
r
,
&
filterElem
,
fp
))
{
exprQualified
=
1
;
exprQualified
=
1
;
...
@@ -5205,12 +5205,14 @@ int32_t initFilterFp(SExprInfo* pExpr, int32_t numOfOutput, SArray** fps) {
...
@@ -5205,12 +5205,14 @@ int32_t initFilterFp(SExprInfo* pExpr, int32_t numOfOutput, SArray** fps) {
int32_t
upper
=
filterInfo
->
upperRelOptr
;
int32_t
upper
=
filterInfo
->
upperRelOptr
;
if
(
lower
==
TSDB_RELATION_INVALID
&&
upper
==
TSDB_RELATION_INVALID
)
{
if
(
lower
==
TSDB_RELATION_INVALID
&&
upper
==
TSDB_RELATION_INVALID
)
{
qError
(
"invalid rel optr"
);
qError
(
"invalid rel optr"
);
taosArrayDestroy
(
es
);
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
__filter_func_t
ffp
=
getFilterOperator
(
lower
,
upper
);
__filter_func_t
ffp
=
getFilterOperator
(
lower
,
upper
);
if
(
ffp
==
NULL
)
{
if
(
ffp
==
NULL
)
{
qError
(
"invalid filter info"
);
qError
(
"invalid filter info"
);
taosArrayDestroy
(
es
);
return
TSDB_CODE_QRY_APP_ERROR
;
return
TSDB_CODE_QRY_APP_ERROR
;
}
}
...
...
tests/script/general/parser/having_child.sim
浏览文件 @
71badf8c
...
@@ -769,7 +769,46 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 ha
...
@@ -769,7 +769,46 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 ha
sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having LEASTSQUARES(f1,1,1) > 2;
sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having LEASTSQUARES(f1,1,1) > 2;
sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having sum(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1),LEASTSQUARES(f1,1,1) from tb1 group by f1 having sum(f1) > 2;
if $rows != 3 then
return -1
endi
if $data00 != 2.000000000 then
return -1
endi
if $data01 != 2 then
return -1
endi
if $data02 != 4 then
return -1
endi
if $data03 != 0.000000000 then
return -1
endi
if $data10 != 3.000000000 then
return -1
endi
if $data11 != 2 then
return -1
endi
if $data12 != 6 then
return -1
endi
if $data13 != 0.000000000 then
return -1
endi
if $data20 != 4.000000000 then
return -1
endi
if $data21 != 2 then
return -1
endi
if $data22 != 8 then
return -1
endi
if $data23 != 0.000000000 then
return -1
endi
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having min(f1) > 2;
sql select avg(f1),count(tb1.*),sum(f1),stddev(f1) from tb1 group by f1 having min(f1) > 2;
if $rows != 2 then
if $rows != 2 then
...
@@ -1072,7 +1111,13 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1),first(f
...
@@ -1072,7 +1111,13 @@ sql_error select avg(f1),count(tb1.*),sum(f1),stddev(f1),min(f1),max(f1),first(f
sql_error select PERCENTILE(f1) from tb1 group by f1 having sum(f1) > 1;
sql_error select PERCENTILE(f1) from tb1 group by f1 having sum(f1) > 1;
sql_error select PERCENTILE(f1,20) from tb1 group by f1 having sum(f1) > 1;
sql select PERCENTILE(f1,20) from tb1 group by f1 having sum(f1) = 4;
if $rows != 1 then
return -1
endi
if $data00 != 2.000000000 then
return -1
endi
sql select aPERCENTILE(f1,20) from tb1 group by f1 having sum(f1) > 1;
sql select aPERCENTILE(f1,20) from tb1 group by f1 having sum(f1) > 1;
if $rows != 4 then
if $rows != 4 then
...
@@ -1396,30 +1441,28 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f
...
@@ -1396,30 +1441,28 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f
sql_error select avg(f1),spread(f1,f2,tb1.f1),avg(id1) from tb1 group by id1 having avg(f1) > id1;
sql_error select avg(f1),spread(f1,f2,tb1.f1),avg(id1) from tb1 group by id1 having avg(f1) > id1;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) > 0;
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) > 0 and avg(f1) = 3;
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 !=
2.5
00000000 then
if $data00 !=
3.0
00000000 then
return -1
return -1
endi
endi
if $data01 !=
3
.000000000 then
if $data01 !=
0
.000000000 then
return -1
return -1
endi
endi
if $data02 !=
3
.000000000 then
if $data02 !=
0
.000000000 then
return -1
return -1
endi
endi
if $data03 != 3.000000000 then
if $data03 != 0.000000000 then
return -1
endi
if $data04 != 1 then
return -1
return -1
endi
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) < 2;
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) < 0 and avg(f1) = 3;
if $rows != 0 then
return -1
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) < 2;
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 0 group by f1 having avg(f1) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f1 > 0 group by f1 having avg(f1) > 0;
if $rows != 4 then
if $rows != 4 then
...
@@ -1814,23 +1857,32 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group
...
@@ -1814,23 +1857,32 @@ sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group
sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group by id1 having last(f6) > 0;
sql_error select avg(f1),spread(f1,f2,tb1.f1),f1,f6 from tb1 where f2 > 1 group by id1 having last(f6) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1
group by id
1 having last(f6) > 0;
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1
and f2 < 4 group by f
1 having last(f6) > 0;
if $rows !=
1
then
if $rows !=
2
then
return -1
return -1
endi
endi
if $data00 !=
3
.000000000 then
if $data00 !=
2
.000000000 then
return -1
return -1
endi
endi
if $data01 !=
2
.000000000 then
if $data01 !=
0
.000000000 then
return -1
return -1
endi
endi
if $data02 !=
2
.000000000 then
if $data02 !=
0
.000000000 then
return -1
return -1
endi
endi
if $data03 !=
2
.000000000 then
if $data03 !=
0
.000000000 then
return -1
return -1
endi
endi
if $data04 != 1 then
if $data10 != 3.000000000 then
return -1
endi
if $data11 != 0.000000000 then
return -1
endi
if $data12 != 0.000000000 then
return -1
endi
if $data13 != 0.000000000 then
return -1
return -1
endi
endi
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录