MySQL
8.0.39
Source Code Documentation
program.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 PROGRAM_INCLUDED
27
#define PROGRAM_INCLUDED
28
29
#include <atomic>
30
#include <optional>
31
32
#include "
client/base/abstract_connection_program.h
"
33
#include "
client/dump/mysql_chain_element_options.h
"
34
#include "
client/dump/mysqldump_tool_chain_maker_options.h
"
35
36
namespace
Mysql
{
37
namespace
Tools {
38
namespace
Dump {
39
40
class
Program
:
public
Mysql::Tools::Base::Abstract_connection_program
{
41
public
:
42
Program
();
43
44
~Program
()
override
;
45
46
std::string
get_version
()
override
;
47
48
int
get_first_release_year
()
override
;
49
50
std::string
get_description
()
override
;
51
52
int
execute
(
const
std::vector<std::string> &positional_options)
override
;
53
54
void
create_options
()
override
;
55
56
void
error
(
const
Mysql::Tools::Base::Message_data
&message)
override
;
57
58
void
short_usage
()
override
;
59
60
void
check_mutually_exclusive_options
();
61
62
int
get_total_connections
();
63
64
int
get_error_code
()
override
;
65
66
private
:
67
bool
message_handler
(
const
Mysql::Tools::Base::Message_data
&message);
68
void
error_log_file_callback
(
char
*);
69
void
close_redirected_stderr
();
70
71
Mysql_chain_element_options
*
m_mysql_chain_element_options
;
72
Mysqldump_tool_chain_maker_options
*
m_mysqldump_tool_chain_maker_options
;
73
bool
m_single_transaction
;
74
bool
m_watch_progress
;
75
std::optional<std::string>
m_error_log_file
;
76
FILE
*
m_stderr
;
77
std::atomic<uint32_t>
m_error_code
;
78
};
79
80
}
// namespace Dump
81
}
// namespace Tools
82
}
// namespace Mysql
83
84
#endif
abstract_connection_program.h
Mysql::Tools::Base::Abstract_connection_program
Base class for all programs that use connection to MySQL database server.
Definition:
abstract_connection_program.h:46
Mysql::Tools::Base::Message_data
Structure to represent message from server sent after executing query.
Definition:
message_data.h:49
Mysql::Tools::Dump::Mysql_chain_element_options
Definition:
mysql_chain_element_options.h:37
Mysql::Tools::Dump::Mysqldump_tool_chain_maker_options
Definition:
mysqldump_tool_chain_maker_options.h:44
Mysql::Tools::Dump::Program
Definition:
program.h:40
Mysql::Tools::Dump::Program::get_description
std::string get_description() override
Returns string describing shortly current program.
Definition:
program.cc:231
Mysql::Tools::Dump::Program::m_stderr
FILE * m_stderr
Definition:
program.h:76
Mysql::Tools::Dump::Program::error_log_file_callback
void error_log_file_callback(char *)
Definition:
program.cc:50
Mysql::Tools::Dump::Program::close_redirected_stderr
void close_redirected_stderr()
Definition:
program.cc:46
Mysql::Tools::Dump::Program::execute
int execute(const std::vector< std::string > &positional_options) override
Runs main program code.
Definition:
program.cc:143
Mysql::Tools::Dump::Program::m_mysqldump_tool_chain_maker_options
Mysqldump_tool_chain_maker_options * m_mysqldump_tool_chain_maker_options
Definition:
program.h:72
Mysql::Tools::Dump::Program::m_error_log_file
std::optional< std::string > m_error_log_file
Definition:
program.h:75
Mysql::Tools::Dump::Program::message_handler
bool message_handler(const Mysql::Tools::Base::Message_data &message)
Definition:
program.cc:63
Mysql::Tools::Dump::Program::get_first_release_year
int get_first_release_year() override
Returns year of first release of this program.
Definition:
program.cc:235
Mysql::Tools::Dump::Program::get_total_connections
int get_total_connections()
Definition:
program.cc:123
Mysql::Tools::Dump::Program::m_error_code
std::atomic< uint32_t > m_error_code
Definition:
program.h:77
Mysql::Tools::Dump::Program::get_version
std::string get_version() override
Returns string describing current version of this program.
Definition:
program.cc:237
Mysql::Tools::Dump::Program::m_mysql_chain_element_options
Mysql_chain_element_options * m_mysql_chain_element_options
Definition:
program.h:71
Mysql::Tools::Dump::Program::m_watch_progress
bool m_watch_progress
Definition:
program.h:74
Mysql::Tools::Dump::Program::create_options
void create_options() override
Creates all options that will be provided.
Definition:
program.cc:80
Mysql::Tools::Dump::Program::check_mutually_exclusive_options
void check_mutually_exclusive_options()
Definition:
program.cc:106
Mysql::Tools::Dump::Program::short_usage
void short_usage() override
Prints program invocation message.
Definition:
program.cc:245
Mysql::Tools::Dump::Program::~Program
~Program() override
Definition:
program.cc:239
Mysql::Tools::Dump::Program::Program
Program()
Definition:
program.cc:254
Mysql::Tools::Dump::Program::m_single_transaction
bool m_single_transaction
Definition:
program.h:73
Mysql::Tools::Dump::Program::get_error_code
int get_error_code() override
Return error code.
Definition:
program.cc:141
Mysql::Tools::Dump::Program::error
void error(const Mysql::Tools::Base::Message_data &message) override
Handles general errors.
Definition:
program.cc:68
mysql_chain_element_options.h
mysqldump_tool_chain_maker_options.h
Mysql
Definition:
abstract_connection_program.h:38
consts::FILE
const std::string FILE("FILE")
client
dump
program.h
Generated by
1.9.2