MySQL 8.0.40
Source Code Documentation
view_table_impl.h
Go to the documentation of this file.
1/* Copyright (c) 2014, 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 DD__VIEW_TABLE_IMPL_INCLUDED
25#define DD__VIEW_TABLE_IMPL_INCLUDED
26
27#include <sys/types.h>
28#include <new>
29
31#include "sql/dd/impl/types/weak_object_impl.h" // dd::Weak_object_impl
32#include "sql/dd/string_type.h"
33#include "sql/dd/types/view_table.h" // dd::View_table
34
35namespace dd {
36
37///////////////////////////////////////////////////////////////////////////
38
39class Object_key;
40class Object_table;
41class Open_dictionary_tables_ctx;
42class View;
43class View_impl;
44class Weak_object;
45
46///////////////////////////////////////////////////////////////////////////
47
49 public:
51
53
54 View_table_impl(const View_table_impl &src, View_impl *parent);
55
56 ~View_table_impl() override = default;
57
58 public:
60
61 const Object_table &object_table() const override;
62
63 bool validate() const override;
64
65 bool store_attributes(Raw_record *r) override;
66
67 bool restore_attributes(const Raw_record &r) override;
68
69 void debug_print(String_type &outb) const override;
70
72
73 virtual uint ordinal_position() const { return -1; }
74
75 public:
76 /////////////////////////////////////////////////////////////////////////
77 // table_catalog.
78 /////////////////////////////////////////////////////////////////////////
79
80 const String_type &table_catalog() const override { return m_table_catalog; }
81
84 }
85
86 /////////////////////////////////////////////////////////////////////////
87 // table_schema.
88 /////////////////////////////////////////////////////////////////////////
89
90 const String_type &table_schema() const override { return m_table_schema; }
91
94 }
95
96 /////////////////////////////////////////////////////////////////////////
97 // table_name.
98 /////////////////////////////////////////////////////////////////////////
99
100 const String_type &table_name() const override { return m_table_name; }
101
102 void set_table_name(const String_type &table_name) override {
104 }
105
106 /////////////////////////////////////////////////////////////////////////
107 // view.
108 /////////////////////////////////////////////////////////////////////////
109
110 const View &view() const override;
111
112 View &view() override;
113
114 public:
116 return new (std::nothrow) View_table_impl(view);
117 }
118
120 return new (std::nothrow) View_table_impl(other, view);
121 }
122
123 public:
124 Object_key *create_primary_key() const override;
125 bool has_new_primary_key() const override;
126
127 private:
131
132 // References to other objects
134};
135
136///////////////////////////////////////////////////////////////////////////
137
138} // namespace dd
139
140#endif // DD__VIEW_TABLE_IMPL_INCLUDED
Definition: object_key.h:38
This class represents all data dictionary table like mysql.tables, mysql.columns and more.
Definition: object_table.h:72
Auxiliary class for opening dictionary tables.
Definition: transaction_impl.h:76
Definition: raw_record.h:46
Definition: view_impl.h:57
Definition: view_table_impl.h:48
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:116
bool restore_attributes(const Raw_record &r) override
Definition: view_table_impl.cc:75
static View_table_impl * clone(const View_table_impl &other, View_impl *view)
Definition: view_table_impl.h:119
virtual uint ordinal_position() const
Definition: view_table_impl.h:73
void debug_print(String_type &outb) const override
Definition: view_table_impl.cc:98
static View_table_impl * restore_item(View_impl *view)
Definition: view_table_impl.h:115
~View_table_impl() override=default
const Object_table & object_table() const override
Definition: view_table_impl.cc:131
String_type m_table_schema
Definition: view_table_impl.h:129
void set_ordinal_position(uint)
Definition: view_table_impl.h:71
View_impl * m_view
Definition: view_table_impl.h:133
void set_table_schema(const String_type &table_schema) override
Definition: view_table_impl.h:92
const String_type & table_name() const override
Definition: view_table_impl.h:100
bool validate() const override
Definition: view_table_impl.cc:63
String_type m_table_name
Definition: view_table_impl.h:130
static void register_tables(Open_dictionary_tables_ctx *otx)
Definition: view_table_impl.cc:137
const View & view() const override
Definition: view_table_impl.cc:57
void set_table_name(const String_type &table_name) override
Definition: view_table_impl.h:102
const String_type & table_catalog() const override
Definition: view_table_impl.h:80
String_type m_table_catalog
Definition: view_table_impl.h:128
Object_key * create_primary_key() const override
Definition: view_table_impl.cc:111
bool store_attributes(Raw_record *r) override
Definition: view_table_impl.cc:89
const String_type & table_schema() const override
Definition: view_table_impl.h:90
void set_table_catalog(const String_type &table_catalog) override
Definition: view_table_impl.h:82
Definition: view_table.h:42
Definition: view.h:39
Definition: weak_object_impl.h:48
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
unsigned int uint
Definition: uca9-dump.cc:75