MySQL 8.0.40
Source Code Documentation
|
Searches DB objects using connection to MYSQL server. More...
#include <mysql_crawler.h>
Public Member Functions | |
Mysql_crawler (I_connection_provider *connection_provider, std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator, Mysql_chain_element_options *options, Mysqldump_tool_chain_maker_options *m_mysqldump_tool_cmaker_options, Mysql::Tools::Base::Abstract_program *program) | |
void | enumerate_objects () override |
Enumerates all objects it can access, gets chains from all registered chain_maker for each object and then execute each chain. More... | |
void | register_progress_watcher (I_progress_watcher *new_progress_watcher) override |
Add new Progress Watcher to report to. More... | |
uint64 | get_id () const override |
Returns an application unique ID of this chain element object. More... | |
Public Member Functions inherited from Mysql::Tools::Dump::Abstract_crawler | |
void | register_chain_maker (I_chain_maker *new_chain_maker) override |
Adds new Chain Maker to ask for chains for found objects. More... | |
~Abstract_crawler () override | |
Public Member Functions inherited from Mysql::Tools::Dump::Abstract_chain_element | |
Abstract_chain_element & | operator= (Abstract_chain_element &&other)=delete |
Disable move assignment to avoid Wvirtual-move-assign warning. More... | |
Public Member Functions inherited from Mysql::Tools::Dump::I_chain_element | |
~I_chain_element () override | |
Public Member Functions inherited from Mysql::Tools::Dump::I_progress_reporter | |
virtual | ~I_progress_reporter () |
Protected Member Functions | |
void | item_completion_in_child_callback (Item_processing_data *item_processed) override |
This callback can be requested to be called by child for any object processing. More... | |
Protected Member Functions inherited from Mysql::Tools::Dump::Abstract_crawler | |
Abstract_crawler (std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator, Mysql::Tools::Base::Abstract_program *program) | |
void | process_dump_task (I_dump_task *new_dump_task) |
Routine for performing common work on each enumerated DB object. More... | |
void | wait_for_tasks_completion () |
bool | need_callbacks_in_child () override |
Mysql::Tools::Base::Abstract_program * | get_program () |
Protected Member Functions inherited from Mysql::Tools::Dump::Abstract_chain_element | |
Abstract_chain_element (std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator) | |
template<typename TType , typename TClass > | |
bool | try_process_task (Item_processing_data *item_to_process, void(TClass::*processing_func)(TType *, Item_processing_data *)) |
Process task object with specified function if that task object can be casted to type TType. More... | |
template<typename TType , typename TClass > | |
bool | try_process_task (Item_processing_data *item_to_process, void(TClass::*processing_func)(TType *)) |
Process task object with specified function if that task object can be casted to type TType. More... | |
void | object_processing_starts (Item_processing_data *item_to_process) |
Item_processing_data * | object_to_be_processed_in_child (Item_processing_data *current_item_data, I_chain_element *child_chain_element) |
Item_processing_data * | new_task_created (I_dump_task *dump_task_created) |
Item_processing_data * | new_chain_created (Chain_data *new_chain_data, Item_processing_data *parent_processing_data, I_chain_element *child_chain_element) |
Item_processing_data * | new_chain_created (Item_processing_data *current_item_data, I_dump_task *dump_task_created) |
void | object_processing_ends (Item_processing_data *processed_item) |
uint64 | generate_new_object_id () |
Simple_id_generator * | get_object_id_generator () const |
void | pass_message (const Mysql::Tools::Base::Message_data &message_data) |
Passes message to message callback. More... | |
std::function< bool(const Mysql::Tools::Base::Message_data &)> * | get_message_handler () const |
Protected Member Functions inherited from Mysql::Tools::Dump::Abstract_progress_reporter | |
bool | have_progress_watcher () |
Specifies if have any Progress Watcher registered. More... | |
void | report_new_chain_created (Item_processing_data *new_chain_creator) |
Reports new non-empty chain being created by Chain Maker or new row fetched from table by Table Reader. More... | |
void | report_object_processing_started (Item_processing_data *process_data) |
Report new object(table, row or any other) was started processing by specified Object Reader, Table Reader, Formatter or Row Formatter. More... | |
void | report_object_processing_ended (Item_processing_data *finished_process_data) |
Report object(table, row or any other) finished being processed. More... | |
virtual void | report_crawler_completed (I_crawler *crawler) |
Reports crawler ended enumerating objects and creating chains for them. More... | |
void | register_progress_watchers_in_child (I_progress_reporter *reporter) |
Protected Member Functions inherited from Mysql::Tools::Dump::Abstract_mysql_chain_element_extension | |
Abstract_mysql_chain_element_extension (I_connection_provider *connection_provider, std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, const Mysql_chain_element_options *options) | |
Mysql::Tools::Base::Mysql_query_runner * | get_runner () const |
I_connection_provider * | get_connection_provider () const |
uint64 | get_server_version () |
std::string | get_server_version_string () |
int | compare_no_case_latin_with_db_string (const std::string &latin_name, const std::string &db_name) |
std::optional< std::string > | get_create_statement (Mysql::Tools::Base::Mysql_query_runner *runner, const std::string &database_name, const std::string &object_name, const std::string &object_type, uint field_id=1) |
Gets CREATE statement for specified object. More... | |
std::string | quote_name (const std::string &name) |
Quotes char string, taking into account compatible mode. More... | |
std::string | get_quoted_object_full_name (const Abstract_data_object *object) |
std::string | get_quoted_object_full_name (const std::string &database_name, const std::string &object_name) |
const Mysql_chain_element_options * | get_mysql_chain_element_options () const |
CHARSET_INFO * | get_charset () const |
Private Member Functions | |
void | enumerate_database_objects (const Database &db) |
void | enumerate_tables (const Database &db) |
void | enumerate_table_triggers (const Table &table, Abstract_dump_task *dependency) |
void | enumerate_column_statistics (const Table &table, Abstract_dump_task *dependency) |
void | enumerate_views (const Database &db) |
template<typename TObject > | |
void | enumerate_functions (const Database &db, std::string type) |
void | enumerate_event_scheduler_events (const Database &db) |
void | enumerate_users () |
std::string | get_version_specific_statement (std::string create_string, const std::string &keyword, std::string main_version, std::string definer_version) |
Rewrite statement, enclosing it with version specific comment and with DEFINER clause enclosed in version-specific comment. More... | |
Searches DB objects using connection to MYSQL server.
Mysql_crawler::Mysql_crawler | ( | I_connection_provider * | connection_provider, |
std::function< bool(const Mysql::Tools::Base::Message_data &)> * | message_handler, | ||
Simple_id_generator * | object_id_generator, | ||
Mysql_chain_element_options * | options, | ||
Mysqldump_tool_chain_maker_options * | m_mysqldump_tool_cmaker_options, | ||
Mysql::Tools::Base::Abstract_program * | program | ||
) |
|
private |
|
private |
|
private |
|
private |
|
overridevirtual |
Enumerates all objects it can access, gets chains from all registered chain_maker for each object and then execute each chain.
Implements Mysql::Tools::Dump::I_crawler.
|
private |
|
private |
|
private |
|
private |
|
inlineoverridevirtual |
Returns an application unique ID of this chain element object.
This helps progress watching with multiple parts of chain during all objects processing.
Reimplemented from Mysql::Tools::Dump::Abstract_crawler.
|
private |
Rewrite statement, enclosing it with version specific comment and with DEFINER clause enclosed in version-specific comment.
This function parses any CREATE statement and encloses DEFINER-clause in version-specific comment: input query: CREATE DEFINER=aFUNCTION ... rewritten query: / *!50003 CREATE * / / *!50020 DEFINER=a* / / *!50003 FUNCTION ... * /
|
inlineoverrideprotectedvirtual |
This callback can be requested to be called by child for any object processing.
This will be called when the object processing has completed. Note that this function may be called from multiple threads so all implementations must be thread-safe.
Reimplemented from Mysql::Tools::Dump::Abstract_crawler.
|
inlineoverridevirtual |
Add new Progress Watcher to report to.
Reimplemented from Mysql::Tools::Dump::Abstract_crawler.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |