[TD-225] fix bugs in regression test.

This commit is contained in:
Haojun Liao 2020-11-24 12:00:17 +08:00
parent c17d202e0c
commit c3fd294c0b
4 changed files with 57 additions and 3 deletions

View File

@ -81,6 +81,7 @@ int32_t getNumOfAllocatedResultRows(SResultRowPool* p);
int32_t getNumOfUsedResultRows(SResultRowPool* p); int32_t getNumOfUsedResultRows(SResultRowPool* p);
uint64_t getResultInfoUId(SQueryRuntimeEnv* pRuntimeEnv); uint64_t getResultInfoUId(SQueryRuntimeEnv* pRuntimeEnv);
bool isPointInterpoQuery(SQuery *pQuery);
#endif // TDENGINE_QUERYUTIL_H #endif // TDENGINE_QUERYUTIL_H

View File

@ -1825,7 +1825,7 @@ static bool isFixedOutputQuery(SQueryRuntimeEnv* pRuntimeEnv) {
} }
// todo refactor with isLastRowQuery // todo refactor with isLastRowQuery
static bool isPointInterpoQuery(SQuery *pQuery) { bool isPointInterpoQuery(SQuery *pQuery) {
for (int32_t i = 0; i < pQuery->numOfOutput; ++i) { for (int32_t i = 0; i < pQuery->numOfOutput; ++i) {
int32_t functionID = pQuery->pExpr1[i].base.functionId; int32_t functionID = pQuery->pExpr1[i].base.functionId;
if (functionID == TSDB_FUNC_INTERP) { if (functionID == TSDB_FUNC_INTERP) {

View File

@ -388,6 +388,12 @@ uint64_t getResultInfoUId(SQueryRuntimeEnv* pRuntimeEnv) {
return 0; // for simple table query, the uid is always set to be 0; return 0; // for simple table query, the uid is always set to be 0;
} }
SQuery* pQuery = pRuntimeEnv->pQuery;
if ((pQuery->checkBuffer == 1 && pQuery->interval.interval == 0) || isPointInterpoQuery(pQuery) ||
pRuntimeEnv->groupbyNormalCol) {
return 0;
}
STableId* id = TSDB_TABLEID(pRuntimeEnv->pQuery->current); STableId* id = TSDB_TABLEID(pRuntimeEnv->pQuery->current);
return id->uid; return id->uid;
} }

View File

@ -323,9 +323,56 @@ sql select c2-c2, 911 from $tb
#======================================= aggregation function arithmetic query cases ================ #======================================= aggregation function arithmetic query cases ================
# asc/desc order [d.2] # asc/desc order [d.2]
sql select first(c1) * ( 2 / 3 ) from $stb order by ts asc; sql select first(c1) * ( 2 / 3 ) from $stb order by ts asc;
sql select (count(c1) * 2) % 7.9 from $stb order by ts desc; if $rows != 1 then
return -1
endi
sql select spread(c1 )/44 from $stb order by ts asc; if $data00 != 0.000000000 then
return -1
endi
sql select first(c1) * (2/99) from $stb order by ts desc;
if $rows != 1 then
return -1
endi
if $data00 != 0.000000000 then
return -1
endi
sql select (count(c1) * 2) % 7.9, (count(c1) * 2), ( count(1)*2) from $stb order by ts desc;
if $rows != 1 then
return -1
endi
if $data00 != 1.800000000 then
return -1
endi
if $data01 != 100000 then
return -1
endi
if $data02 != 200000 then
return -1
endi
sql select spread( c1 )/44, spread(c1), 0.204545455 * 44 from $stb order by ts asc;
if $rows != 1 then
return -1
endi
if $data00 != 0.204545455 then
return -1
endi
if $data01 != 9.000000000 then
return -1
endi
if $data02 != 9.000000020 then
return -1
endi
# all possible function in the arithmetic expressioin # all possible function in the arithmetic expressioin
sql select min(c1) * max(c2) /4, sum(c1) * percentile(c2, 20), apercentile(c4, 33) + 52/9, spread(c5)/min(c2) from $stb where ts < and ts > sql select min(c1) * max(c2) /4, sum(c1) * percentile(c2, 20), apercentile(c4, 33) + 52/9, spread(c5)/min(c2) from $stb where ts < and ts >