MySQL 8.0.37
Source Code Documentation
mysql_object_reader.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2024, Oracle and/or its affiliates.
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, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is designed to work with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef MYSQL_OBJECT_READER_INCLUDED
27#define MYSQL_OBJECT_READER_INCLUDED
28
29#include <functional>
30
38#include "my_inttypes.h"
39
40namespace Mysql {
41namespace Tools {
42namespace Dump {
43
44/**
45 Parses any DB object(excluding rows and privileges for DB objects) data using
46 connection to MySQL server.
47 */
49 public I_object_reader,
51 public:
53 I_connection_provider *connection_provider,
54 std::function<bool(const Mysql::Tools::Base::Message_data &)>
55 *message_handler,
56 Simple_id_generator *object_id_generator,
58
59 void read_object(Item_processing_data *item_to_process) override;
60
61 void format_rows(Item_processing_data *item_to_process,
62 Row_group_dump_task *row_group);
63
64 // Fix "inherits ... via dominance" warnings
66 I_progress_watcher *new_progress_watcher) override {
68 }
69
70 // Fix "inherits ... via dominance" warnings
71 uint64 get_id() const override { return Abstract_chain_element::get_id(); }
72
73 protected:
74 // Fix "inherits ... via dominance" warnings
76 Item_processing_data *item_processed) override {
78 }
79
80 private:
81 void read_table_rows_task(Table_rows_dump_task *table_rows_dump_task,
82 Item_processing_data *item_to_process);
83
85
87 public:
89 Item_processing_data *item_processing,
90 bool has_generated_columns,
91 bool has_invisible_columns);
92
95
96 void process_buffer();
98
99 private:
100 void acquire_fields_information(MYSQL_RES *mysql_result);
101
105 std::vector<Mysql_field> m_fields;
106 };
107};
108
109} // namespace Dump
110} // namespace Tools
111} // namespace Mysql
112
113#endif
Structure to represent message from server sent after executing query.
Definition: message_data.h:49
Definition: mysql_query_runner.h:137
void register_progress_watcher(I_progress_watcher *new_progress_watcher) override
Add new Progress Watcher to report to.
Definition: abstract_chain_element.h:58
uint64 get_id() const override
Returns an application unique ID of this chain element object.
Definition: abstract_chain_element.cc:36
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.
Definition: abstract_chain_element.cc:150
Implementation of common logic for classes that directs execution of dump tasks to Data Formatters.
Definition: abstract_data_formatter_wrapper.h:43
Definition: abstract_mysql_chain_element_extension.h:48
Definition: i_connection_provider.h:38
Definition: i_object_reader.h:36
Definition: i_progress_watcher.h:37
Data structure for objects that are processed in any chain.
Definition: item_processing_data.h:43
Mysql_object_reader * m_parent
Definition: mysql_object_reader.h:102
int64 result_callback(const Mysql::Tools::Base::Mysql_query_runner::Row &row_data)
Definition: mysql_object_reader.cc:51
void process_buffer()
Definition: mysql_object_reader.cc:44
bool is_all_rows_processed()
Definition: mysql_object_reader.cc:76
Rows_fetching_context(Mysql_object_reader *parent, Item_processing_data *item_processing, bool has_generated_columns, bool has_invisible_columns)
Definition: mysql_object_reader.cc:65
Item_processing_data * m_item_processing
Definition: mysql_object_reader.h:103
void acquire_fields_information(MYSQL_RES *mysql_result)
Definition: mysql_object_reader.cc:35
Row_group_dump_task m_row_group
Definition: mysql_object_reader.h:104
std::vector< Mysql_field > m_fields
Definition: mysql_object_reader.h:105
Definition: mysql_object_reader_options.h:40
Parses any DB object(excluding rows and privileges for DB objects) data using connection to MySQL ser...
Definition: mysql_object_reader.h:50
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.
Definition: mysql_object_reader.h:75
void format_rows(Item_processing_data *item_to_process, Row_group_dump_task *row_group)
Definition: mysql_object_reader.cc:153
Mysql_object_reader(I_connection_provider *connection_provider, std::function< bool(const Mysql::Tools::Base::Message_data &)> *message_handler, Simple_id_generator *object_id_generator, const Mysql_object_reader_options *options)
Definition: mysql_object_reader.cc:169
const Mysql_object_reader_options * m_options
Definition: mysql_object_reader.h:84
uint64 get_id() const override
Returns an application unique ID of this chain element object.
Definition: mysql_object_reader.h:71
void read_object(Item_processing_data *item_to_process) override
Reads information on DB object related to task.
Definition: mysql_object_reader.cc:158
void read_table_rows_task(Table_rows_dump_task *table_rows_dump_task, Item_processing_data *item_to_process)
Definition: mysql_object_reader.cc:80
void register_progress_watcher(I_progress_watcher *new_progress_watcher) override
Add new Progress Watcher to report to.
Definition: mysql_object_reader.h:65
Represents single data row.
Definition: row_group_dump_task.h:43
Definition: simple_id_generator.h:37
Represents task for extracting rows of single DB table.
Definition: table_rows_dump_task.h:38
Some integer typedefs for easier portability.
int64_t int64
Definition: my_inttypes.h:68
uint64_t uint64
Definition: my_inttypes.h:69
Definition: abstract_connection_program.h:38
Definition: options.cc:49
Definition: mysql.h:339