MySQL 8.1.0
Source Code Documentation
view_table_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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_TABLE_IMPL_INCLUDED
24#define DD__VIEW_TABLE_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_table.h" // dd::View_table
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
53 View_table_impl(const View_table_impl &src, View_impl *parent);
54
55 ~View_table_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 // table_catalog.
77 /////////////////////////////////////////////////////////////////////////
78
79 const String_type &table_catalog() const override { return m_table_catalog; }
80
83 }
84
85 /////////////////////////////////////////////////////////////////////////
86 // table_schema.
87 /////////////////////////////////////////////////////////////////////////
88
89 const String_type &table_schema() const override { return m_table_schema; }
90
93 }
94
95 /////////////////////////////////////////////////////////////////////////
96 // table_name.
97 /////////////////////////////////////////////////////////////////////////
98
99 const String_type &table_name() const override { return m_table_name; }
100
101 void set_table_name(const String_type &table_name) override {
103 }
104
105 /////////////////////////////////////////////////////////////////////////
106 // view.
107 /////////////////////////////////////////////////////////////////////////
108
109 const View &view() const override;
110
111 View &view() override;
112
113 public:
115 return new (std::nothrow) View_table_impl(view);
116 }
117
119 return new (std::nothrow) View_table_impl(other, view);
120 }
121
122 public:
123 Object_key *create_primary_key() const override;
124 bool has_new_primary_key() const override;
125
126 private:
130
131 // References to other objects
133};
134
135///////////////////////////////////////////////////////////////////////////
136
137} // namespace dd
138
139#endif // DD__VIEW_TABLE_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_table_impl.h:47
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_table_impl.cc:115
bool restore_attributes(const Raw_record &r) override
Definition: view_table_impl.cc:74
static View_table_impl * clone(const View_table_impl &other, View_impl *view)
Definition: view_table_impl.h:118
virtual uint ordinal_position() const
Definition: view_table_impl.h:72
void debug_print(String_type &outb) const override
Definition: view_table_impl.cc:97
static View_table_impl * restore_item(View_impl *view)
Definition: view_table_impl.h:114
~View_table_impl() override=default
const Object_table & object_table() const override
Definition: view_table_impl.cc:130
String_type m_table_schema
Definition: view_table_impl.h:128
void set_ordinal_position(uint)
Definition: view_table_impl.h:70
View_impl * m_view
Definition: view_table_impl.h:132
void set_table_schema(const String_type &table_schema) override
Definition: view_table_impl.h:91
const String_type & table_name() const override
Definition: view_table_impl.h:99
bool validate() const override
Definition: view_table_impl.cc:62
String_type m_table_name
Definition: view_table_impl.h:129
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: view_table_impl.cc:136
const View & view() const override
Definition: view_table_impl.cc:56
void set_table_name(const String_type &table_name) override
Definition: view_table_impl.h:101
const String_type & table_catalog() const override
Definition: view_table_impl.h:79
String_type m_table_catalog
Definition: view_table_impl.h:127
Object_key * create_primary_key() const override
Definition: view_table_impl.cc:110
bool store_attributes(Raw_record *r) override
Definition: view_table_impl.cc:88
const String_type & table_schema() const override
Definition: view_table_impl.h:89
void set_table_catalog(const String_type &table_catalog) override
Definition: view_table_impl.h:81
Definition: view_table.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