MySQL 8.3.0
Source Code Documentation
parse_tree_window.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2023, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef SQL_PARSE_TREE_WINDOW_INCLUDED
24#define SQL_PARSE_TREE_WINDOW_INCLUDED
25
27#include "sql/sql_list.h"
28#include "sql/window.h"
29
30class Item_string;
31class PT_frame;
32class PT_order_list;
33
34/**
35 Parse tree node for a window; just a shallow wrapper for
36 class Window, q.v.
37*/
38class PT_window : public Parse_tree_node, public Window {
40
41 public:
42 PT_window(const POS &pos, PT_order_list *partition_by,
43 PT_order_list *order_by, PT_frame *frame)
44 : super(pos), Window(partition_by, order_by, frame) {}
45
46 PT_window(const POS &pos, PT_order_list *partition_by,
47 PT_order_list *order_by, PT_frame *frame, Item_string *inherit)
48 : super(pos), Window(partition_by, order_by, frame, inherit) {}
49
50 PT_window(const POS &pos, Item_string *name) : super(pos), Window(name) {}
51
52 bool do_contextualize(Parse_context *pc) override;
53
54 protected:
55 void add_json_info(Json_object *obj) override;
56};
57
58/**
59 Parse tree node for a list of window definitions corresponding
60 to a <window clause> in SQL 2003.
61*/
65
66 public:
67 explicit PT_window_list(const POS &pos) : super(pos) {}
68
69 bool do_contextualize(Parse_context *pc) override;
70
71 bool push_back(PT_window *w) { return m_windows.push_back(w); }
72};
73
74#endif // SQL_PARSE_TREE_WINDOW_INCLUDED
Definition: item.h:5440
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:367
Definition: sql_list.h:434
Parse tree node for a window's frame, cf.
Definition: parse_tree_nodes.h:1440
Definition: parse_tree_nodes.h:231
Parse tree node for a list of window definitions corresponding to a <window clause> in SQL 2003.
Definition: parse_tree_window.h:62
PT_window_list(const POS &pos)
Definition: parse_tree_window.h:67
bool push_back(PT_window *w)
Definition: parse_tree_window.h:71
Parse_tree_node super
Definition: parse_tree_window.h:63
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:76
List< Window > m_windows
Definition: parse_tree_window.h:64
Parse tree node for a window; just a shallow wrapper for class Window, q.v.
Definition: parse_tree_window.h:38
Parse_tree_node super
Definition: parse_tree_window.h:39
PT_window(const POS &pos, PT_order_list *partition_by, PT_order_list *order_by, PT_frame *frame, Item_string *inherit)
Definition: parse_tree_window.h:46
PT_window(const POS &pos, PT_order_list *partition_by, PT_order_list *order_by, PT_frame *frame)
Definition: parse_tree_window.h:42
PT_window(const POS &pos, Item_string *name)
Definition: parse_tree_window.h:50
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:34
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_window.cc:52
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:230
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:104
const PT_frame * frame() const
Get the frame, if any.
Definition: window.h:779
Item_string * name() const
Get the name of a window.
Definition: window.h:771
Bison "location" class.
Definition: parse_location.h:42
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:419