Skip to content

Commit

Permalink
fix: order by function
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Jan 4, 2024
1 parent fd5a368 commit d2eb040
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/planner/binder/order_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ void OrderBinder::PushExtraExprToSelectList(ParsedExpr *expr, const SharedPtr<Bi
return;
}

if (expr->type_ == ParsedExprType::kFunction) {
return;
}

bind_context_ptr->select_expr_name2index_[expr_name] = bind_context_ptr->select_expression_.size();
bind_context_ptr->select_expression_.emplace_back(expr);
}
Expand Down
10 changes: 9 additions & 1 deletion test/sql/dql/sort_by_function.slt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,12 @@ select c1, c2 from t1 order by c1 + c2, c1;
0 1
1 4
2 3
1 5
1 5

query II
select c1, c2, c1 + c2 from t1 order by c1 + c2, c1;
----
0 1 1
1 4 5
2 3 5
1 5 6

0 comments on commit d2eb040

Please sign in to comment.