mariadb_get_infov - Man Page
Name
mariadb_get_infov - retrieves generic or connection related information
Synopsis
#include <mysql.h> int mariadb_get_infov(MYSQL * mysql, enum mariadb_value value, void * arg, ...);
Description
Retrieves generic or connection specific information. arg
(and further arguments) must be a pointer to a variable of the type appropriate for the value
argument. The following table shows which variable type to use for each value.
Variable Type | Values |
unsigned int | MARIADB_CLIENT_VERSION_ID , MARIADB_CONNECTION_ASYNC_TIMEOUT , MARIADB_CONNECTION_ASYNC_TIMEOUT_MS , MARIADB_CONNECTION_ERROR_ID , MARIADB_CONNECTION_PORT , MARIADB_CONNECTION_PROTOCOL_VERSION_ID , MARIADB_CONNECTION_PVIO_TYPE , MARIADB_CONNECTION_SERVER_STATUS , MARIADB_CONNECTION_SERVER_VERSION_ID , MARIADB_CONNECTION_TLS_VERSION_ID |
unsigned long | MARIADB_CONNECTION_CLIENT_CAPABILITIES , MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES , MARIADB_CONNECTION_SERVER_CAPABILITIES |
size_t | MARIADB_MAX_ALLOWED_PACKET , MARIADB_NET_BUFFER_LENGTH |
const char * | MARIADB_CLIENT_VERSION , MARIADB_TLS_LIBRARY , MARIADB_CONNECTION_ERROR , MARIADB_CONNECTION_HOST , MARIADB_CONNECTION_INFO , MARIADB_CONNECTION_SCHEMA , MARIADB_CONNECTION_SERVER_TYPE , MARIADB_CONNECTION_SERVER_VERSION , MARIADB_CONNECTION_SQLSTATE , MARIADB_CONNECTION_SSL_CIPHER , MARIADB_CONNECTION_TLS_VERSION , MARIADB_CONNECTUION_UNIX_SOCKET , MARIADB_CONNECTION_USER , |
const char ** | MARIADB_CLIENT_ERRORS |
const *MY_CHARSET_INFO | MARIADB_CHARSET_NAME , MARIADB_CONNECTION_CHARSET_INFO |
my_socket | MARIADB_CONNECTION_SOCKET |
MARIADB_X509_INFO * | MARIADB_TLS_PEER_CERT_INFO |
Value types
Generic information
For these information types parameter mysql
needs to be set to NULL.
MARIADB_CHARSET_NAME
Retrieves the charset information for a character set by it’s literal representation.
MARIADB_CLIENT_ERRORS
Retrieve array of client errors. This can be used in plugins to set global error messages (which are not exported by MariaDB Connector/C).
MARIADB_CLIENT_VERSION
The client version in literal representation.
MARIADB_CLIENT_VERSION_ID
The client version in numeric format.
MARIADB_MAX_ALLOWED_PACKET
Retrieves value of maximum allowed packet size.
MARIADB_NET_BUFFER_LENGTH
Retrieves the length of net buffer.
Returns
Returns zero on success, non zero if an error occurred (e.g. if an invalid option was specified),
Source file
libmariadb/mariadb_lib.c
History
This function was added in MariaDB Connector/C 3.0,
Examples
/* get server port for current connection */ unsigned int port; mariadb_get_infov(mysql, MARIADB_CONNECTION_PORT, (void *)&port);
/* get user name for current connection */ const char *user; mariadb_get_infov(mysql, MARIADB_CONNECTION_USER, (void *)&user);
See also
- mysql_get_optionv(3)
Referenced By
mysql_error(3), mysql_get_character_set_info(3), mysql_select_db(3).