提交 71badf8c 编写于 作者: D dapan1121

fix filter error

上级 a5b4ae69
......@@ -4709,7 +4709,7 @@ void doHavingImpl(SOperatorInfo *pOperator, SSDataBlock *pBlock) {
//SColIndex* colIdx = &pExprInfo->base.colInfo;
SColumnInfoData* p = taosArrayGet(pBlock->pDataBlock, i);
SColumnFilterElem filterElem = {.filterInfo = *pExprInfo->pFilter};
SColumnFilterElem filterElem = {.filterInfo = pExprInfo->pFilter[m]};
if (doFilterData(p, r, &filterElem, fp)) {
exprQualified = 1;
......@@ -5205,12 +5205,14 @@ int32_t initFilterFp(SExprInfo* pExpr, int32_t numOfOutput, SArray** fps) {
int32_t upper = filterInfo->upperRelOptr;
if (lower == TSDB_RELATION_INVALID && upper == TSDB_RELATION_INVALID) {
qError("invalid rel optr");
taosArrayDestroy(es);
return TSDB_CODE_QRY_APP_ERROR;
}
__filter_func_t ffp = getFilterOperator(lower, upper);
if (ffp == NULL) {
qError("invalid filter info");
taosArrayDestroy(es);
return TSDB_CODE_QRY_APP_ERROR;
}
......
......@@ -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 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;
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
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;
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
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
return -1
endi
if $data00 != 2.500000000 then
if $data00 != 3.000000000 then
return -1
endi
if $data01 != 3.000000000 then
if $data01 != 0.000000000 then
return -1
endi
if $data02 != 3.000000000 then
if $data02 != 0.000000000 then
return -1
endi
if $data03 != 3.000000000 then
return -1
endi
if $data04 != 1 then
if $data03 != 0.000000000 then
return -1
endi
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) < 2;
if $rows != 0 then
return -1
endi
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by f1 having avg(f1) < 0 and avg(f1) = 3;
sql_error select avg(f1),spread(f1,f2,tb1.f1) from tb1 group by id1 having avg(f1) < 2;
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
......@@ -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 select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 group by id1 having last(f6) > 0;
if $rows != 1 then
sql select avg(f1),spread(f1,f2,tb1.f1) from tb1 where f2 > 1 and f2 < 4 group by f1 having last(f6) > 0;
if $rows != 2 then
return -1
endi
if $data00 != 3.000000000 then
if $data00 != 2.000000000 then
return -1
endi
if $data01 != 2.000000000 then
if $data01 != 0.000000000 then
return -1
endi
if $data02 != 2.000000000 then
if $data02 != 0.000000000 then
return -1
endi
if $data03 != 2.000000000 then
if $data03 != 0.000000000 then
return -1
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
endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册