Skip to content

Commit 42ededf

Browse files
committed
Create a default frame bound when no frame is specified.
1 parent 974e65d commit 42ededf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sql/sql_window.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,18 @@ class Frame_current_row : public Frame_n_rows
752752

753753
Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound)
754754
{
755+
// TODO-cvicentiu When a frame is not specified, which is the frame type
756+
// that we will use?
757+
// Postgres uses RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW.
758+
// For now we use UNBOUNDED FOLLOWING and UNBOUNDED PRECEDING.
759+
if (!frame)
760+
{
761+
if (is_top_bound)
762+
return new Frame_unbounded_preceding;
763+
else
764+
return new Frame_unbounded_following;
765+
}
766+
755767
Window_frame_bound *bound= is_top_bound? frame->top_bound :
756768
frame->bottom_bound;
757769

0 commit comments

Comments
 (0)