![]() |
MySQL 8.2.0
Source Code Documentation
|
Options provider providing options to specify connection to MySQL server. More...
#include <mysql_connection_options.h>
Classes | |
class | Ssl_options |
Options provider enclosing options related to SSL settings of connection to MySQL server. More... | |
Public Member Functions | |
Mysql_connection_options (Abstract_program *program) | |
Constructs new MySQL server connection options provider. More... | |
void | create_options () override |
Creates all options that will be provided. More... | |
MYSQL * | create_connection () override |
Provides new connection to MySQL database server based on option values. More... | |
CHARSET_INFO * | get_current_charset () const |
Retrieves charset that will be used in new MySQL connections. More... | |
void | set_current_charset (CHARSET_INFO *charset) |
Sets charset that will be used in new MySQL connections. More... | |
![]() | |
void | add_providers (I_options_provider *first,...) |
Adds new providers to list. More... | |
void | add_provider (I_options_provider *options_provider) |
Adds new provider to list. More... | |
void | options_parsed () override |
This callback is to be called after all options were parsed. More... | |
std::vector< my_option > | generate_options () override |
Aggregates all options from itsself and all contained providers. More... | |
![]() | |
Simple_option * | create_new_option (std::string name, std::string description) |
Creates and attach new simple option. More... | |
Disabled_option * | create_new_disabled_option (std::string name, std::string description) |
Creates and attach new disabled option. More... | |
Char_array_option * | create_new_option (char **value, std::string name, std::string description) |
Creates and attach new string option stored in char* type object. More... | |
Password_option * | create_new_password_option (std::optional< std::string > *value, std::string name, std::string description) |
Creates and attach new password option. More... | |
String_option * | create_new_option (std::optional< std::string > *value, std::string name, std::string description) |
Creates and attach new string option. More... | |
Number_option< int32 > * | create_new_option (int32 *value, std::string name, std::string description) |
Creates and attach new 32-bit signed number option. More... | |
Number_option< uint32 > * | create_new_option (uint32 *value, std::string name, std::string description) |
Creates and attach new 32-bit unsigned number option. More... | |
Number_option< int64 > * | create_new_option (int64 *value, std::string name, std::string description) |
Creates and attach new 64-bit signed number option. More... | |
Number_option< uint64 > * | create_new_option (uint64 *value, std::string name, std::string description) |
Creates and attach new 64-bit unsigned number option. More... | |
Number_option< double > * | create_new_option (double *value, std::string name, std::string description) |
Creates and attach new floating-point number option. More... | |
Bool_option * | create_new_option (bool *value, std::string name, std::string description) |
Creates and attach new boolean option with value received from argument. More... | |
template<typename T_type , typename T_typelib > | |
Enum_option< T_type, T_typelib > * | create_new_enum_option (T_type *value, const T_typelib *type, std::string name, std::string description) |
![]() | |
virtual | ~I_option_changed_listener ()=default |
Private Member Functions | |
const char * | get_null_or_string (std::optional< std::string > &maybeString) |
Returns pointer to constant array containing specified string or NULL value if string has length 0. More... | |
void | db_error (MYSQL *connection, const char *when) |
Prints database connection error and exits program. More... | |
void | protocol_callback (char *not_used) |
![]() | |
virtual | ~I_connection_factory ()=default |
Private Attributes | |
Ssl_options | m_ssl_options_provider |
Abstract_program * | m_program |
std::optional< std::string > | m_protocol_string |
uint32 | m_protocol |
std::optional< std::string > | m_bind_addr |
std::optional< std::string > | m_host |
uint32 | m_mysql_port |
std::optional< std::string > | m_mysql_unix_port |
std::optional< std::string > | m_default_auth |
std::optional< std::string > | m_plugin_dir |
uint32 | m_net_buffer_length |
uint32 | m_max_allowed_packet |
bool | m_compress |
std::optional< std::string > | m_user |
std::optional< std::string > | m_password [3] |
std::optional< std::string > | m_default_charset |
std::optional< std::string > | m_server_public_key |
bool | m_get_server_public_key |
uint | m_zstd_compress_level |
std::optional< std::string > | m_compress_algorithm |
Static Private Attributes | |
static bool | mysql_inited |
Additional Inherited Members | |
![]() | |
Abstract_options_provider () | |
~Abstract_options_provider () override | |
void | set_option_changed_listener (I_option_changed_listener *listener) override |
Sets optional option changes listener to which all changes in all options contained in this provider should be reported. More... | |
Options provider providing options to specify connection to MySQL server.
|
explicit |
Constructs new MySQL server connection options provider.
Calling this function from multiple threads simultaneously is not thread safe.
program | Pointer to main program class. |
|
overridevirtual |
Provides new connection to MySQL database server based on option values.
Implementation of I_connection_factory interface.
Implements Mysql::Tools::Base::I_connection_factory.
|
overridevirtual |
Creates all options that will be provided.
Implementation of Abstract_options_provider virtual method.
Implements Mysql::Tools::Base::Options::Abstract_options_provider.
|
private |
Prints database connection error and exits program.
CHARSET_INFO * Mysql_connection_options::get_current_charset | ( | ) | const |
Retrieves charset that will be used in new MySQL connections.
. Can be NULL if none was set explicitly.
|
private |
Returns pointer to constant array containing specified string or NULL value if string has length 0.
|
private |
void Mysql_connection_options::set_current_charset | ( | CHARSET_INFO * | charset | ) |
Sets charset that will be used in new MySQL connections.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |