MySQL 8.4.2
Source Code Documentation
parse_tree_window.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2024, 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 designed to work 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 either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef SQL_PARSE_TREE_WINDOW_INCLUDED
25#define SQL_PARSE_TREE_WINDOW_INCLUDED
26
28#include "sql/sql_list.h"
29#include "sql/window.h"
30
31class Item_string;
32class PT_frame;
33class PT_order_list;
34
35/**
36 Parse tree node for a window; just a shallow wrapper for
37 class Window, q.v.
38*/
39class PT_window : public Parse_tree_node, public Window {
41
42 public:
43 PT_window(const POS &pos, PT_order_list *partition_by,
44 PT_order_list *order_by, PT_frame *frame)
45 : super(pos), Window(partition_by, order_by, frame) {}
46
47 PT_window(const POS &pos, PT_order_list *partition_by,
48 PT_order_list *order_by, PT_frame *frame, Item_string *inherit)
49 : super(pos), Window(partition_by, order_by, frame, inherit) {}
50
51 PT_window(const POS &pos, Item_string *name) : super(pos), Window(name) {}
52
53 bool do_contextualize(Parse_context *pc) override;
54
55 protected:
56 void add_json_info(Json_object *obj) override;
57};
58
59/**
60 Parse tree node for a list of window definitions corresponding
61 to a <window clause> in SQL 2003.
62*/
66
67 public:
68 explicit PT_window_list(const POS &pos) : super(pos) {}
69
70 bool do_contextualize(Parse_context *pc) override;
71
72 bool push_back(PT_window *w) { return m_windows.push_back(w); }
73};
74
75#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:369
Definition: sql_list.h:467
Parse tree node for a window's frame, cf.
Definition: parse_tree_nodes.h:1464
Definition: parse_tree_nodes.h:233
Parse tree node for a list of window definitions corresponding to a <window clause> in SQL 2003.
Definition: parse_tree_window.h:63
PT_window_list(const POS &pos)
Definition: parse_tree_window.h:68
bool push_back(PT_window *w)
Definition: parse_tree_window.h:72
Parse_tree_node super
Definition: parse_tree_window.h:64
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:77
List< Window > m_windows
Definition: parse_tree_window.h:65
Parse tree node for a window; just a shallow wrapper for class Window, q.v.
Definition: parse_tree_window.h:39
Parse_tree_node super
Definition: parse_tree_window.h:40
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:47
PT_window(const POS &pos, PT_order_list *partition_by, PT_order_list *order_by, PT_frame *frame)
Definition: parse_tree_window.h:43
PT_window(const POS &pos, Item_string *name)
Definition: parse_tree_window.h:51
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:35
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_window.cc:53
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:231
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:110
const PT_frame * frame() const
Get the frame, if any.
Definition: window.h:785
Item_string * name() const
Get the name of a window.
Definition: window.h:777
Bison "location" class.
Definition: parse_location.h:43
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:420