23#ifndef DD_SYSTEM_VIEWS__SYSTEM_VIEW_DEFINITION_IMPL_INCLUDED
24#define DD_SYSTEM_VIEWS__SYSTEM_VIEW_DEFINITION_IMPL_INCLUDED
35namespace system_views {
84 bool add_quotes =
false) {
94 if (field_name ==
"*") {
98 assert(field_definition.find(
'\'') == String_type::npos);
99 ss <<
'\'' << field_definition <<
'\'';
101 ss << field_definition;
103 ss <<
" AS " << field_name;
176 for (Field_definitions::const_iterator field =
180 ss <<
" " << field->second;
190 ss <<
"\n " << *from;
198 ss <<
"\n " << *
where;
208 ss <<
"CREATE OR REPLACE DEFINER=`mysql.infoschema`@`localhost` VIEW "
252 bool first_query_block =
true;
257 if (first_query_block) {
258 ss <<
"CREATE OR REPLACE DEFINER=`mysql.infoschema`@`localhost` VIEW "
259 <<
"information_schema." <<
view_name() <<
" AS "
260 <<
"(" << select->build_select_query() <<
")";
261 first_query_block =
false;
264 <<
"(" << select->build_select_query() <<
")";
Definition: system_view_definition_impl.h:37
virtual void set_view_name(const String_type &name)
Set view name.
Definition: system_view_definition_impl.h:49
String_type build_ddl_create_view() const override=0
Build CREATE VIEW DDL statement for the system view.
static const String_type fs_name_collation()
Get collation clause to append to view definition for some view columns based on lower_case_table_nam...
Definition: system_view_definition_impl.h:57
String_type m_view_name
Definition: system_view_definition_impl.h:66
virtual const String_type & view_name() const
Get view name.
Definition: system_view_definition_impl.h:44
Definition: system_view_definition.h:36
Definition: system_view_definition_impl.h:69
virtual int field_number(const String_type &field_name) const
Get the field ordinal position number for the given field name.
Definition: system_view_definition_impl.h:156
virtual void add_field(int field_number, const String_type &field_name, const String_type &field_definition, bool add_quotes=false)
Add a field definition for the SELECT projection.
Definition: system_view_definition_impl.h:82
virtual void add_where(const String_type &where)
Add WHERE clause for the SELECT.
Definition: system_view_definition_impl.h:127
String_type build_select_query() const
Build the SELECT query that is used in the CREATE VIEW command.
Definition: system_view_definition_impl.h:166
virtual void add_from(const String_type &from)
Add FROM clause for the SELECT.
Definition: system_view_definition_impl.h:116
virtual void add_cte_expression(const String_type &cte)
Add CTE expression before SELECT.
Definition: system_view_definition_impl.h:136
Where_clauses m_where_clauses
Definition: system_view_definition_impl.h:230
std::map< String_type, int > Field_numbers
Definition: system_view_definition_impl.h:216
Field_definitions m_field_definitions
Definition: system_view_definition_impl.h:228
virtual void add_star()
Indicates selection of all field (SELECT '*').
Definition: system_view_definition_impl.h:148
virtual void add_distinct()
Indicates that we should add DISTINCT clause to SELECT.
Definition: system_view_definition_impl.h:143
std::map< int, String_type > Field_definitions
Definition: system_view_definition_impl.h:219
From_clauses m_from_clauses
Definition: system_view_definition_impl.h:229
bool m_is_distinct
Definition: system_view_definition_impl.h:232
dd::String_type m_cte_expression
Definition: system_view_definition_impl.h:231
Field_numbers m_field_numbers
Definition: system_view_definition_impl.h:227
String_type build_ddl_create_view() const override
Build CREATE VIEW DDL statement for the system view.
Definition: system_view_definition_impl.h:206
bool m_add_star
Definition: system_view_definition_impl.h:233
std::vector< String_type > From_clauses
Definition: system_view_definition_impl.h:222
std::vector< String_type > Where_clauses
Definition: system_view_definition_impl.h:225
Definition: system_view_definition_impl.h:237
std::unique_ptr< System_view_select_definition_impl > Select_definition
Definition: system_view_definition_impl.h:272
System_view_select_definition_impl & get_query_block()
Get the object for a SELECT definition to be used in the UNION.
Definition: system_view_definition_impl.h:244
std::vector< Select_definition > m_selects
Definition: system_view_definition_impl.h:275
String_type build_ddl_create_view() const override
Build CREATE VIEW DDL statement for the system view.
Definition: system_view_definition_impl.h:250
uint lower_case_table_names
Definition: mysqld.cc:1323
static char * where
Definition: mysqldump.cc:136
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
Char_stringstream_template< String_type_allocator > Stringstream_type
Instantiation of std::basic_stringstream with the same allocator as String_type.
Definition: string_type.h:71
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
case opt name
Definition: sslopt-case.h:32