MySQL 26.10.0
Source Code Documentation
s_mysql_mysql_command_options Struct Reference

A service that provides the apis for mysql command get_option and set_option. More...

#include <mysql_command_services.h>

Public Attributes

mysql_service_status_t(* set )(MYSQL_H mysql, int option, const void *arg)
 Calls mysql_options api to sets connect options for connection-establishment functions such as real_connect(). More...
 
mysql_service_status_t(* get )(MYSQL_H mysql, int option, const void *arg)
 Calls mysql_get_option api to returns the value of a mysql_options() option. More...
 

Detailed Description

A service that provides the apis for mysql command get_option and set_option.

Member Data Documentation

◆ get

mysql_service_status_t(* s_mysql_mysql_command_options::get) (MYSQL_H mysql, int option, const void *arg)

Calls mysql_get_option api to returns the value of a mysql_options() option.

Parameters
[in]mysqlA valid mysql object.
[in]optionThe option argument is the option that you want to get.
[out]argThe arg argument is the value for the option to store.
Return values
truefailure
falsesuccess

◆ set

mysql_service_status_t(* s_mysql_mysql_command_options::set) (MYSQL_H mysql, int option, const void *arg)

Calls mysql_options api to sets connect options for connection-establishment functions such as real_connect().

Parameters
[in]mysqlA valid mysql object.
[in]optionThe option argument is the option that you want to set.
[in]argThe arg argument is the value for the option.

-----------—+----------------------------—+-----------------------------—+ Type | Option |Explanation | -----------—+----------------------------—+-----------------------------—+ const char * |MYSQL_TEXT_CONSUMER_* |Service implementation name for | | |the selected text consumer. | | |Null selects its default. | -----------—+----------------------------—+-----------------------------—+ MYSQL_THD |MYSQL_COMMAND_LOCAL_THD_HANDLE |The THD to run the query in. | | |If null a new internal THD will | | |be created. | -----------—+----------------------------—+-----------------------------—+ const char * |MYSQL_COMMAND_PROTOCOL |Socket/pipe name for | | |authentication. Null or "local" | | |uses defaults; unused by | | |embedded sessions. | -----------—+----------------------------—+-----------------------------—+ const char * |MYSQL_COMMAND_USER_NAME |The user name to send to the | | |server/set into the thread's | | |security context. | -----------—+----------------------------—+-----------------------------—+ const char * |MYSQL_COMMAND_HOST_NAME |The host name to use to | | |connect/set into the thread's | | |security context. | -----------—+----------------------------—+-----------------------------—+ int |MYSQL_COMMAND_TCPIP_PORT |The port to use to connect. | -----------—+----------------------------—+-----------------------------—+ const void * |MYSQL_NO_LOCK_REGISTRY |Non-null selects the no-lock | | |registry; null selects the | | |regular registry. | -----------—+----------------------------—+-----------------------------—+ uint32_t |MYSQL_COMMAND_CLIENT_FLAGS |Client flags passed to | | |mysql_real_connect() and exposed| | |by the default capabilities | | |consumer. | -----------—+----------------------------—+-----------------------------—+ const char * |MYSQL_COMMAND_PASSWORD |Password used to authenticate | | |against the current server. | -----------—+----------------------------—+-----------------------------—+ bool |MYSQL_COMMAND_BYPASS_MAX_ |Bypass max_connections for new | |CONNECTIONS |embedded sessions. Default: | | |true. | -----------—+----------------------------—+-----------------------------—+

Note
MYSQL_COMMAND_USER_NAME and MYSQL_COMMAND_HOST_NAME are copied by set() and retained across failed connect() attempts until replaced or the handle is closed. These options cannot be changed after an embedded session is created.
MYSQL_COMMAND_PASSWORD is write-only and non-owning. The pointer must remain valid until connect() returns. A non-null pointer, including an empty string, selects normal authentication against the current server. A null pointer selects the embedded backend. After an authenticated connection attempt, close and reinitialize the handle before connecting again.
MYSQL_COMMAND_BYPASS_MAX_CONNECTIONS accepts a non-null bool pointer. The default is true, preserving the connection-limit exemption. When false, embedded sessions created by connect() are subject to max_connections and cannot use the reserved extra connection slot. Both modes contribute to the connection count and preserve the session's SQL privileges. Administrative admission bypasses only the connection limit; other errors can still prevent connection establishment. Set this option before creating a session and only for embedded connections. Normal admission is incompatible with MYSQL_COMMAND_LOCAL_THD_HANDLE and a non-null MYSQL_COMMAND_PASSWORD. The setting survives failed connect() attempts; get() returns the configured boolean.
Authenticated connections are limited to the current server's local socket or named pipe, or loopback TCP endpoint. They are incompatible with MYSQL_COMMAND_LOCAL_THD_HANDLE, MYSQL_NO_LOCK_REGISTRY, MYSQL_TEXT_CONSUMER_* options, and client option-file settings. Loopback TCP supports only literal bind_address values: *, the matching address-family wildcard, or the matching loopback address. Hostname and multi-address values are rejected. Loopback TCP defaults to preferred TLS and permits server public-key retrieval.
For the other mysql client options it calls the mysql_options api.
Return values
truefailure
falsesuccess

The documentation for this struct was generated from the following file: