提交 b4856f62 编写于 作者: M Minglei Jin

fix: remove order by ts limitation with top/bottom function

上级 c096c671
......@@ -6900,7 +6900,7 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
const char* msg5 = "only primary timestamp/column in top/bottom function allowed as order column";
const char* msg6 = "only primary timestamp allowed as the second order column";
const char* msg7 = "only primary timestamp/column in groupby clause allowed as order column";
const char* msg8 = "only column in groupby clause allowed as order column";
//const char* msg8 = "only column in groupby clause allowed as order column";
const char* msg10 = "not support distinct mixed with order by";
const char* msg11 = "not support order with udf";
const char* msg12 = "order by tags not supported with diff/derivative/csum/mavg/stateCount/stateDuration";
......@@ -7117,11 +7117,11 @@ int32_t validateOrderbyNode(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, SSqlNode* pSq
}else if (isTopBottomUniqueQuery(pQueryInfo)) {
SArray *columnInfo = pQueryInfo->groupbyExpr.columnInfo;
if (columnInfo != NULL && taosArrayGetSize(columnInfo) > 0) {
SColIndex* pColIndex = taosArrayGet(columnInfo, 0);
/*SColIndex* pColIndex = taosArrayGet(columnInfo, 0);
if (pColIndex->colIndex != index.columnIndex) {
return invalidOperationMsg(pMsgBuf, msg8);
}
}*/
} else {
int32_t pos = tscExprTopBottomIndex(pQueryInfo);
assert(pos > 0);
......
......@@ -130,7 +130,7 @@ class TDTestCase:
tdSql.error("select top(tbcol1, 12) from st1 order by tbcol1,ts")
tdSql.error("select top(tbcol1, 12) from st order by tbcol1,ts,tbcol2")
tdSql.error("select top(tbcol1, 12) from st order by ts, tbcol1")
tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2")
#tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2")
fun_list = ['avg','count','twa','sum','stddev','leastsquares','min',
'max','first','last','top','bottom','percentile','apercentile',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册