Skip to content

Commit

Permalink
[CBRD-25318] Problem that the subquery containing orderby_num() is vi…
Browse files Browse the repository at this point in the history
…ew-merged. (CUBRID#5140)

http://jira.cubrid.org/browse/CBRD-25318

Problem that the subquery containing orderby_num() is view-merged. 
add check for order_by.
  • Loading branch information
shparkcubrid committed Aug 5, 2024
1 parent bef4364 commit 27b94ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/parser/view_transform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,7 +1735,9 @@ mq_is_pushable_subquery (PARSER_CONTEXT * parser, PT_NODE * subquery, PT_NODE *

/* determine if class_spec is the only spec in the statement */
is_rownum_only = mq_is_rownum_only_predicate (parser, statement_spec, mainquery, order_by, subquery, class_);
is_only_spec = ((statement_spec->next == NULL && (pred == NULL || is_rownum_only)) ? true : false);
is_only_spec =
((statement_spec->next == NULL && (pred == NULL || is_rownum_only)
&& (subquery->info.query.order_by == NULL || order_by == NULL)) ? true : false);

/* check if orderby_for set to PT_EXPR_INFO_ROWNUM_ONLY */
orderby_for = subquery->info.query.orderby_for;
Expand Down

0 comments on commit 27b94ba

Please sign in to comment.