24#ifndef DD_SYSTEM_VIEWS__SYSTEM_VIEW_DEFINITION_IMPL_INCLUDED 
   25#define DD_SYSTEM_VIEWS__SYSTEM_VIEW_DEFINITION_IMPL_INCLUDED 
   36namespace system_views {
 
   85                         bool add_quotes = 
false) {
 
   95    if (field_name == 
"*") {
 
   99        assert(field_definition.find(
'\'') == String_type::npos);
 
  100        ss << 
'\'' << field_definition << 
'\'';
 
  102        ss << field_definition;
 
  104      ss << 
" AS " << field_name;
 
  177      for (Field_definitions::const_iterator field =
 
  181        ss << 
"  " << field->second;
 
  191      ss << 
"\n  " << *from;
 
  199      ss << 
"\n  " << *
where;
 
  209    ss << 
"CREATE OR REPLACE DEFINER=`mysql.infoschema`@`localhost` VIEW " 
  253    bool first_query_block = 
true;
 
  258      if (first_query_block) {
 
  259        ss << 
"CREATE OR REPLACE DEFINER=`mysql.infoschema`@`localhost` VIEW " 
  260           << 
"information_schema." << 
view_name() << 
" AS " 
  261           << 
"(" << select->build_select_query() << 
")";
 
  262        first_query_block = 
false;
 
  265           << 
"(" << select->build_select_query() << 
")";
 
Definition: system_view_definition_impl.h:38
 
virtual void set_view_name(const String_type &name)
Set view name.
Definition: system_view_definition_impl.h:50
 
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:58
 
String_type m_view_name
Definition: system_view_definition_impl.h:67
 
virtual const String_type & view_name() const
Get view name.
Definition: system_view_definition_impl.h:45
 
Definition: system_view_definition.h:37
 
Definition: system_view_definition_impl.h:70
 
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:157
 
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:83
 
virtual void add_where(const String_type &where)
Add WHERE clause for the SELECT.
Definition: system_view_definition_impl.h:128
 
String_type build_select_query() const
Build the SELECT query that is used in the CREATE VIEW command.
Definition: system_view_definition_impl.h:167
 
virtual void add_from(const String_type &from)
Add FROM clause for the SELECT.
Definition: system_view_definition_impl.h:117
 
virtual void add_cte_expression(const String_type &cte)
Add CTE expression before SELECT.
Definition: system_view_definition_impl.h:137
 
Where_clauses m_where_clauses
Definition: system_view_definition_impl.h:231
 
std::map< String_type, int > Field_numbers
Definition: system_view_definition_impl.h:217
 
Field_definitions m_field_definitions
Definition: system_view_definition_impl.h:229
 
virtual void add_star()
Indicates selection of all field (SELECT '*').
Definition: system_view_definition_impl.h:149
 
virtual void add_distinct()
Indicates that we should add DISTINCT clause to SELECT.
Definition: system_view_definition_impl.h:144
 
std::map< int, String_type > Field_definitions
Definition: system_view_definition_impl.h:220
 
From_clauses m_from_clauses
Definition: system_view_definition_impl.h:230
 
bool m_is_distinct
Definition: system_view_definition_impl.h:233
 
dd::String_type m_cte_expression
Definition: system_view_definition_impl.h:232
 
Field_numbers m_field_numbers
Definition: system_view_definition_impl.h:228
 
String_type build_ddl_create_view() const override
Build CREATE VIEW DDL statement for the system view.
Definition: system_view_definition_impl.h:207
 
bool m_add_star
Definition: system_view_definition_impl.h:234
 
std::vector< String_type > From_clauses
Definition: system_view_definition_impl.h:223
 
std::vector< String_type > Where_clauses
Definition: system_view_definition_impl.h:226
 
Definition: system_view_definition_impl.h:238
 
std::unique_ptr< System_view_select_definition_impl > Select_definition
Definition: system_view_definition_impl.h:273
 
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:245
 
std::vector< Select_definition > m_selects
Definition: system_view_definition_impl.h:276
 
String_type build_ddl_create_view() const override
Build CREATE VIEW DDL statement for the system view.
Definition: system_view_definition_impl.h:251
 
uint lower_case_table_names
Definition: mysqld.cc:1328
 
static char * where
Definition: mysqldump.cc:140
 
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
 
Char_stringstream_template< String_type_allocator > Stringstream_type
Instantiation of std::basic_stringstream with the same allocator as String_type.
Definition: string_type.h:72
 
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
 
case opt name
Definition: sslopt-case.h:33