D.S

dev.mysql.com

MySQL: client/dump/mysql_crawler.h Source File

MySQL: client/dump/mysql_crawler.h Source File MySQL  8.0.0 Source Code Documentation Main Page Related Pages Modules Namespaces Classes Files File List File Members mysql_crawler.h Go to the documentation of this file. 1 /* 2  Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. 3  4  This program is free software; you can redistribute it and/or modify 5  it under the terms of the GNU General Public License as published by 6  the Free Software Foundation; version 2 of the License. 7  8  This program is distributed in the hope that it will be useful, 9  but WITHOUT ANY WARRANTY; without even the implied warranty of 10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11  GNU General Public License for more details. 12  13  You should have received a copy of the GNU General Public License 14  along with this program; if not, write to the Free Software 15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 */ 17  18 #ifndef MYSQL_CRAWLER_INCLUDED 19 #define MYSQL_CRAWLER_INCLUDED 20  21 #include " abstract_crawler.h " 22 #include " abstract_mysql_chain_element_extension.h " 23 #include " i_connection_provider.h " 24 #include " i_callable.h " 25 #include " dump_start_dump_task.h " 26 #include " abstract_dump_task.h " 27 #include " database.h " 28 #include " table.h " 29 #include " dump_end_dump_task.h " 30 #include " mysql_chain_element_options.h " 31 #include " database_start_dump_task.h " 32 #include " database_end_dump_task.h " 33 #include " tables_definition_ready_dump_task.h " 34 #include " simple_id_generator.h " 35 #include " base/message_data.h " 36 #include " base/abstract_program.h " 37  38 namespace Mysql { 39 namespace Tools{ 40 namespace Dump{ 41  42 /** 43  Searches DB objects using connection to MYSQL server. 44  */ 45  class Mysql_crawler 46  : public Abstract_crawler , public Abstract_mysql_chain_element_extension 47 { 48 public: 49  Mysql_crawler ( 50  I_connection_provider * connection_provider, 51  Mysql::I_callable<bool, const Mysql::Tools::Base::Message_data&> * 52  message_handler, Simple_id_generator * object_id_generator, 53  Mysql_chain_element_options * options , 54  Mysql::Tools::Base::Abstract_program * program ); 55  /** 56  Enumerates all objects it can access, gets chains from all registered 57  chain_maker for each object and then execute each chain. 58  */ 59  virtual void enumerate_objects (); 60  61  // Fix "inherits ... via dominance" warnings 62   void register_progress_watcher ( I_progress_watcher * new_progress_watcher) 63  { Abstract_crawler::register_progress_watcher (new_progress_watcher); } 64  65  // Fix "inherits ... via dominance" warnings 66   uint64 get_id () const 67  { return Abstract_crawler::get_id (); } 68  69 protected: 70  // Fix "inherits ... via dominance" warnings 71   void item_completion_in_child_callback ( Item_processing_data * item_processed) 72  { Abstract_crawler::item_completion_in_child_callback (item_processed); } 73  74 private: 75  void enumerate_database_objects (const Database & db); 76  77  void enumerate_tables (const Database & db); 78  79  void enumerate_table_triggers (const Table & table, 80  Abstract_dump_task * dependency); 81  82  void enumerate_views (const Database & db); 83  84  template<typename TObject>void enumerate_functions ( 85  const Database & db, std::string type); 86  87  void enumerate_event_scheduler_events (const Database & db); 88  89  void enumerate_users (); 90  91  /** 92  Rewrite statement, enclosing it with version specific comment and with 93  DEFINER clause enclosed in version-specific comment. 94  95  This function parses any CREATE statement and encloses DEFINER-clause in 96  version-specific comment: 97  input query: CREATE DEFINER=a@b FUNCTION ... 98  rewritten query: / *!50003 CREATE * / / *!50020 DEFINER=a@b * / / *!50003 99  FUNCTION ... * / 100  */ 101  std::string get_version_specific_statement (std::string create_string , 102  const std::string& keyword, std::string main_version, 103  std::string definer_version); 104  105   Dump_start_dump_task * m_dump_start_task ; 106   Dump_end_dump_task * m_dump_end_task ; 107   Database_start_dump_task * m_current_database_start_dump_task ; 108   Database_end_dump_task * m_current_database_end_dump_task ; 109   Tables_definition_ready_dump_task * m_tables_definition_ready_dump_task ; 110 }; 111  112 } 113 } 114 } 115  116 #endif mysql_chain_element_options.h Mysql::Tools::Dump::Tables_definition_ready_dump_task Represents task for additional work once all Table_definition_dump_task are processed. Definition: tables_definition_ready_dump_task.h:31 Mysql::Tools::Dump::Mysql_crawler::enumerate_functions void enumerate_functions(const Database &db, std::string type) Definition: mysql_crawler.cc:279 database_start_dump_task.h dump_end_dump_task.h i_callable.h program static Program program Definition: program.cc:273 Mysql::Tools::Dump::Table Definition: table.h:31 Mysql::Tools::Dump::Mysql_crawler::enu