From 42ededf4adaed7595a5843a8fbf09fe246a1c3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Mon, 7 Mar 2016 12:30:04 +0200 Subject: [PATCH] Create a default frame bound when no frame is specified. --- sql/sql_window.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sql/sql_window.cc b/sql/sql_window.cc index cb4e1b6e0e0..3ccf35a2ed4 100644 --- a/sql/sql_window.cc +++ b/sql/sql_window.cc @@ -752,6 +752,18 @@ public: Frame_cursor *get_frame_cursor(Window_frame *frame, bool is_top_bound) { + // TODO-cvicentiu When a frame is not specified, which is the frame type + // that we will use? + // Postgres uses RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. + // For now we use UNBOUNDED FOLLOWING and UNBOUNDED PRECEDING. + if (!frame) + { + if (is_top_bound) + return new Frame_unbounded_preceding; + else + return new Frame_unbounded_following; + } + Window_frame_bound *bound= is_top_bound? frame->top_bound : frame->bottom_bound;