未验证 提交 30e7b87c 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #8334 from taosdata/szhou/hotfix/td-10706

[TD-10706]<fix>:csum and mavg only support group by tbname
...@@ -7245,7 +7245,7 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char* ...@@ -7245,7 +7245,7 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char*
const char* msg3 = "group by/session/state_window not allowed on projection query"; const char* msg3 = "group by/session/state_window not allowed on projection query";
const char* msg4 = "retrieve tags not compatible with group by or interval query"; const char* msg4 = "retrieve tags not compatible with group by or interval query";
const char* msg5 = "functions can not be mixed up"; const char* msg5 = "functions can not be mixed up";
const char* msg6 = "TWA/Diff/Derivative/Irate only support group by tbname"; const char* msg6 = "TWA/Diff/Derivative/Irate/CSum/MAvg only support group by tbname";
// only retrieve tags, group by is not supportted // only retrieve tags, group by is not supportted
if (tscQueryTags(pQueryInfo)) { if (tscQueryTags(pQueryInfo)) {
...@@ -7301,7 +7301,8 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char* ...@@ -7301,7 +7301,8 @@ int32_t doFunctionsCompatibleCheck(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, char*
continue; continue;
} }
if ((!pQueryInfo->stateWindow) && (f == TSDB_FUNC_DIFF || f == TSDB_FUNC_DERIVATIVE || f == TSDB_FUNC_TWA || f == TSDB_FUNC_IRATE)) { if ((!pQueryInfo->stateWindow) && (f == TSDB_FUNC_DIFF || f == TSDB_FUNC_DERIVATIVE || f == TSDB_FUNC_TWA ||
f == TSDB_FUNC_IRATE || f == TSDB_FUNC_CSUM || f == TSDB_FUNC_MAVG)) {
for (int32_t j = 0; j < pQueryInfo->groupbyExpr.numOfGroupCols; ++j) { for (int32_t j = 0; j < pQueryInfo->groupbyExpr.numOfGroupCols; ++j) {
SColIndex* pColIndex = taosArrayGet(pQueryInfo->groupbyExpr.columnInfo, j); SColIndex* pColIndex = taosArrayGet(pQueryInfo->groupbyExpr.columnInfo, j);
if (j == 0) { if (j == 0) {
......
...@@ -78,7 +78,9 @@ print ===> $data11 ...@@ -78,7 +78,9 @@ print ===> $data11
if $data11 != 1.000000000 then if $data11 != 1.000000000 then
return -1 return -1
endi endi
sql_error select csum(c7) from $tb sql_error select csum(c7) from $tb
sql_error select csum(c7) from $tb group by c8
sql_error select csum(c8) from $tb sql_error select csum(c8) from $tb
sql_error select csum(c9) from $tb sql_error select csum(c9) from $tb
sql_error select csum(ts) from $tb sql_error select csum(ts) from $tb
......
...@@ -80,6 +80,7 @@ if $data11 != 1.500000000 then ...@@ -80,6 +80,7 @@ if $data11 != 1.500000000 then
endi endi
sql_error select mavg(c7,2) from $tb sql_error select mavg(c7,2) from $tb
sql_error select mavg(c8,2) from $tb sql_error select mavg(c8,2) from $tb
sql_error select mavg(c8,2) from $tb order by c7
sql_error select mavg(c9,2) from $tb sql_error select mavg(c9,2) from $tb
sql_error select mavg(ts,2) from $tb sql_error select mavg(ts,2) from $tb
sql_error select mavg(c1,2), mavg(c2,2) from $tb sql_error select mavg(c1,2), mavg(c2,2) from $tb
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册