FreeBSD manual
download PDF document: mariadb_get_infov.3.pdf
mariadb_get_infov(3) MariaDB Connector/C mariadb_get_infov(3)
Name
mariadb_get_infov - retrieves generic or connection releated
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_VERSION,
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
Value types
Generic information
For these information types parameter mysql needs to be set to NULL.
global error messages (which are not exported by MariaDB Connector/C).
o MARIADB_CLIENT_VERSION
The client version in literal representation.
o MARIADB_CLIENT_VERSION_ID
The client version in numeric format.
o MARIADB_MAX_ALLOWED_PACKET
Retrieves value of maximum allowed packet size.
o MARIADB_NET_BUFFER_LENGTH
Retrieves the length of net buffer.
o MARIADB_SSL_LIBRARY
The TLS library MariaDB Connector/C is compiled against.
Connection related information
For these information types parameter mysql must be represent a valid
connection handle which was allocated by mysql_init(3).
o MARIADB_CONNECTION_ASYNC_TIMEOUT
Retrieves the timeout for non blocking calls in seconds.
o MARIADB_CONNECTION_ASYNC_TIMEOUT_MS
Retrieves the timeout for non blocking calls in milliseconds.
o MARIADB_CONNECTION_CHARSET_INFO
Retrieves character set information for given connection.
o MARIADB_CONNECTION_CLIENT_CAPABILITIES
Returns the handshak capability flags] of the client.
o MARIADB_CONNECTION_ERROR
Retrieves error message for last used command.
o MARIADB_CONNECTION_ERROR_ID
Retrieves error number for last used command.
*MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES
Returns the extended capability flags of the connected MariaDB server
o MARIADB_CONNECTION_HOST
Returns host name of the connected MariaDB server
o MARIADB_CONNECTION_INFO
Retrieves generic info for last used command.
o MARIADB_CONNECTION_PORT
Retrieves the port number of server host.
o MARIADB_CONNECTION_PROTOCOL_VERSION_ID
Retrieves the protocol version number.
o MARIADB_CONNECTION_PVIO_TYPE
Retrieves the pvio plugin used for specified connection.
o MARIADB_CONNECTION_SCHEMA
Retrieves the current schema.
Retrieves the type of the server.
o MARIADB_CONNECTION_SERVER_VERSION
Retrieves the server version in literal format.
o MARIADB_CONNECTION_SERVER_VERSION_ID
Retrieves the server version in numeric format.
o MARIADB_CONNECTION_SOCKET
Retrieves the handle (socket) for given connection.
o MARIADB_CONNECTION_SQLSTATE
Retrieves current sqlstate information for last used command.
o MARIADB_CONNECTION_SSL_CIPHER
Retrieves the TLS/SSL cipher in use.
o MARIADB_CONNECTION_TLS_VERSION
Retrieves the TLS protocol version used in literal format.
o MARIADB_CONNECTION_TLS_VERSION_ID
Retrieves the TLS protocol version used in numeric format.
o MARIADB_CONNECTION_UNIX_SOCKET
Retrieves the file name of the unix socket
o MARIADB_CONNECTION_USER
Retrieves connection's user name.
Returns
Returns zero on success, non zero if an error occurred (e.g. if an
invalid option was specified),
Source file
## 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)
Version 3.3.1 mariadb_get_infov(3)