MySQL 8.3.0
Source Code Documentation
view_routine_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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 DD__VIEW_ROUTINE_IMPL_INCLUDED
24#define DD__VIEW_ROUTINE_IMPL_INCLUDED
25
26#include <sys/types.h>
27#include <new>
28
30#include "sql/dd/impl/types/weak_object_impl.h" // dd::Weak_object_impl
31#include "sql/dd/string_type.h"
32#include "sql/dd/types/view_routine.h" // dd::View_routine
33
34namespace dd {
35
36///////////////////////////////////////////////////////////////////////////
37
38class Object_key;
39class Object_table;
40class Open_dictionary_tables_ctx;
41class View;
42class View_impl;
43class Weak_object;
44
45///////////////////////////////////////////////////////////////////////////
46
48 public:
50
52
54
55 ~View_routine_impl() override = default;
56
57 public:
59
60 const Object_table &object_table() const override;
61
62 bool validate() const override;
63
64 bool store_attributes(Raw_record *r) override;
65
66 bool restore_attributes(const Raw_record &r) override;
67
68 void debug_print(String_type &outb) const override;
69
71
72 virtual uint ordinal_position() const { return -1; }
73
74 public:
75 /////////////////////////////////////////////////////////////////////////
76 // routine catalog.
77 /////////////////////////////////////////////////////////////////////////
78
79 const String_type &routine_catalog() const override {
80 return m_routine_catalog;
81 }
82
83 void set_routine_catalog(const String_type &sf_catalog) override {
84 m_routine_catalog = sf_catalog;
85 }
86
87 /////////////////////////////////////////////////////////////////////////
88 // routine schema.
89 /////////////////////////////////////////////////////////////////////////
90
91 const String_type &routine_schema() const override {
92 return m_routine_schema;
93 }
94
95 void set_routine_schema(const String_type &sf_schema) override {
96 m_routine_schema = sf_schema;
97 }
98
99 /////////////////////////////////////////////////////////////////////////
100 // routine name.
101 /////////////////////////////////////////////////////////////////////////
102
103 const String_type &routine_name() const override { return m_routine_name; }
104
105 void set_routine_name(const String_type &sf_name) override {
106 m_routine_name = sf_name;
107 }
108
109 /////////////////////////////////////////////////////////////////////////
110 // view.
111 /////////////////////////////////////////////////////////////////////////
112
113 const View &view() const override;
114
115 View &view() override;
116
117 public:
119 return new (std::nothrow) View_routine_impl(view);
120 }
121
123 View_impl *view) {
124 return new (std::nothrow) View_routine_impl(other, view);
125 }
126
127 public:
128 Object_key *create_primary_key() const override;
129 bool has_new_primary_key() const override;
130
131 private:
135
136 // References to other objects
138};
139
140///////////////////////////////////////////////////////////////////////////
141
142} // namespace dd
143
144#endif // DD__VIEW_ROUTINE_IMPL_INCLUDED
Definition: object_key.h:37
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:71
Auxiliary class for opening dictionary tables.
Definition: transaction_impl.h:75
Definition: raw_record.h:45
Definition: view_impl.h:54
Definition: view_routine_impl.h:47
void set_routine_catalog(const String_type &sf_catalog) override
Definition: view_routine_impl.h:83
static View_routine_impl * clone(const View_routine_impl &other, View_impl *view)
Definition: view_routine_impl.h:122
bool validate() const override
Definition: view_routine_impl.cc:62
const Object_table & object_table() const override
Definition: view_routine_impl.cc:133
bool store_attributes(Raw_record *r) override
Definition: view_routine_impl.cc:89
bool restore_attributes(const Raw_record &r) override
Definition: view_routine_impl.cc:75
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: view_routine_impl.cc:139
bool has_new_primary_key() const override
Indicates that object is guaranteed to have primary key value which doesn't exist in database (e....
Definition: view_routine_impl.cc:117
virtual uint ordinal_position() const
Definition: view_routine_impl.h:72
const String_type & routine_schema() const override
Definition: view_routine_impl.h:91
const View & view() const override
Definition: view_routine_impl.cc:56
Object_key * create_primary_key() const override
Definition: view_routine_impl.cc:112
~View_routine_impl() override=default
void debug_print(String_type &outb) const override
Definition: view_routine_impl.cc:99
void set_routine_schema(const String_type &sf_schema) override
Definition: view_routine_impl.h:95
const String_type & routine_catalog() const override
Definition: view_routine_impl.h:79
void set_routine_name(const String_type &sf_name) override
Definition: view_routine_impl.h:105
View_impl * m_view
Definition: view_routine_impl.h:137
void set_ordinal_position(uint)
Definition: view_routine_impl.h:70
String_type m_routine_schema
Definition: view_routine_impl.h:133
String_type m_routine_name
Definition: view_routine_impl.h:134
String_type m_routine_catalog
Definition: view_routine_impl.h:132
const String_type & routine_name() const override
Definition: view_routine_impl.h:103
static View_routine_impl * restore_item(View_impl *view)
Definition: view_routine_impl.h:118
Definition: view_routine.h:41
Definition: view.h:38
Definition: weak_object_impl.h:47
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:85