修复了关于rownum的4个bug。
1.最大值只有255,正常应该是无限大。 2.group by跟where rownum < n同时存在时,禁止将rownum优化成limit 3.groupy by后面没有rownum,而having后面有rownum时,会正常运行,正常应该报错。 4.union前后的子句如果有where rownum < n,并且还有含有order by的子查询时,禁止将order by优化删除掉。
This commit is contained in:
@ -1941,6 +1941,10 @@ static void reduce_orderby_recurse(Query* query, Node* jtnode, bool reduce)
|
||||
/* Reduce orderby clause in subquery for join or from clause of more than one rte */
|
||||
reduce_orderby_final(rte, reduce);
|
||||
} else if (IsA(jtnode, FromExpr)) {
|
||||
/* If there is ROWNUM, can not reduce orderby clause in subquery */
|
||||
if (contain_rownum_walker(jtnode, NULL)) {
|
||||
return;
|
||||
}
|
||||
FromExpr* f = (FromExpr*)jtnode;
|
||||
ListCell* l = NULL;
|
||||
bool flag = false;
|
||||
|
||||
Reference in New Issue
Block a user