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