Enable sequence with limit in select statement

This commit is contained in:
hezuojiao 2023-07-11 13:18:34 +00:00 committed by ob-robot
parent 63af839d05
commit 87608e7bff

View File

@ -6013,7 +6013,7 @@ int ObSelectResolver::check_pseudo_column_name_legal(const ObString& name)
/* sequence 有如下禁忌用法:
* 1. limithavingorder bygroup by 使
* 1. havingorder bygroup by 使
* 2. subquery (insert into select )
* 3. where resolve expr
**/
@ -6025,14 +6025,13 @@ int ObSelectResolver::check_sequence_exprs()
ret = OB_ERR_UNEXPECTED;
LOG_WARN("select stmt is null", K(select_stmt));
} else if (select_stmt->has_sequence()) {
if (select_stmt->has_limit() ||
select_stmt->has_order_by() ||
if (select_stmt->has_order_by() ||
select_stmt->has_distinct() ||
select_stmt->has_having() ||
select_stmt->has_group_by() ||
params_.is_from_create_view_) {
ret = OB_ERR_SEQ_NOT_ALLOWED_HERE;
LOG_WARN("sequence can not be used with create-view/select-subquery/orderby/limit/groupby/distinct", K(ret));
LOG_WARN("sequence can not be used with create-view/select-subquery/orderby/groupby/distinct", K(ret));
}
}