'\" t .\" Automatically generated by Pandoc 3.5 .\" .TH "mariadb_get_infov" "3" "" "Version 3.4" "MariaDB Connector/C" .SS Name mariadb_get_infov \- retrieves generic or connection related information .SS Synopsis .IP .EX #include \f[B]\f[R] int mariadb_get_infov(MYSQL * mysql, \f[B]enum\f[R] mariadb_value value, void * arg, ...); .EE .SH Description Retrieves generic or connection specific information. \f[CR]arg\f[R] (and further arguments) must be a pointer to a variable of the type appropriate for the \f[CR]value\f[R] argument. The following table shows which variable type to use for each value. .PP .TS tab(@); lw(35.0n) lw(35.0n). T{ Variable Type T}@T{ Values T} _ T{ \f[CR]unsigned int\f[R] T}@T{ \f[CR]MARIADB_CLIENT_VERSION_ID\f[R], \f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R], \f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R], \f[CR]MARIADB_CONNECTION_ERROR_ID\f[R], \f[CR]MARIADB_CONNECTION_PORT\f[R], \f[CR]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R], \f[CR]MARIADB_CONNECTION_PVIO_TYPE\f[R], \f[CR]MARIADB_CONNECTION_SERVER_STATUS\f[R], \f[CR]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R], \f[CR]MARIADB_CONNECTION_TLS_VERSION_ID\f[R] T} T{ \f[CR]unsigned long\f[R] T}@T{ \f[CR]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R], \f[CR]MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES\f[R], \f[CR]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R] T} T{ \f[CR]size_t\f[R] T}@T{ \f[CR]MARIADB_MAX_ALLOWED_PACKET\f[R], \f[CR]MARIADB_NET_BUFFER_LENGTH\f[R] T} T{ \f[CR]const char *\f[R] T}@T{ \f[CR]MARIADB_CLIENT_VERSION\f[R], \f[CR]MARIADB_TLS_LIBRARY\f[R], \f[CR]MARIADB_CONNECTION_ERROR\f[R], \f[CR]MARIADB_CONNECTION_HOST\f[R], \f[CR]MARIADB_CONNECTION_INFO\f[R], \f[CR]MARIADB_CONNECTION_SCHEMA\f[R], \f[CR]MARIADB_CONNECTION_SERVER_TYPE\f[R], \f[CR]MARIADB_CONNECTION_SERVER_VERSION\f[R], \f[CR]MARIADB_CONNECTION_SQLSTATE\f[R], \f[CR]MARIADB_CONNECTION_SSL_CIPHER\f[R], \f[CR]MARIADB_CONNECTION_TLS_VERSION\f[R], \f[CR]MARIADB_CONNECTUION_UNIX_SOCKET\f[R], \f[CR]MARIADB_CONNECTION_USER\f[R], T} T{ \f[CR]const char **\f[R] T}@T{ \f[CR]MARIADB_CLIENT_ERRORS\f[R] T} T{ \f[CR]const *MY_CHARSET_INFO\f[R] T}@T{ \f[CR]MARIADB_CHARSET_NAME\f[R], \f[CR]MARIADB_CONNECTION_CHARSET_INFO\f[R] T} T{ \f[CR]my_socket\f[R] T}@T{ \f[CR]MARIADB_CONNECTION_SOCKET\f[R] T} T{ \f[CR]MARIADB_X509_INFO *\f[R] T}@T{ \f[CR]MARIADB_TLS_PEER_CERT_INFO\f[R] T} .TE .SS Value types .SS Generic information For these information types parameter \f[CR]mysql\f[R] needs to be set to NULL. .IP \[bu] 2 \f[CR]MARIADB_CHARSET_NAME\f[R] .PD 0 .P .PD Retrieves the charset information for a character set by it\[cq]s literal representation. .IP \[bu] 2 \f[CR]MARIADB_CLIENT_ERRORS\f[R] .PD 0 .P .PD Retrieve array of client errors. This can be used in plugins to set global error messages (which are not exported by MariaDB Connector/C). .IP \[bu] 2 \f[CR]MARIADB_CLIENT_VERSION\f[R] .PD 0 .P .PD The client version in literal representation. .IP \[bu] 2 \f[CR]MARIADB_CLIENT_VERSION_ID\f[R] .PD 0 .P .PD The client version in numeric format. .IP \[bu] 2 \f[CR]MARIADB_MAX_ALLOWED_PACKET\f[R] .PD 0 .P .PD Retrieves value of maximum allowed packet size. .IP \[bu] 2 \f[CR]MARIADB_NET_BUFFER_LENGTH\f[R] .PD 0 .P .PD Retrieves the length of net buffer. .SS Connection and TLS related information For these information types parameter mysql must be represent a valid connection handle which was allocated by \f[B]mysql_init(3)\f[R]. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT\f[R] .PD 0 .P .PD Retrieves the timeout for non blocking calls in seconds. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_ASYNC_TIMEOUT_MS\f[R] .PD 0 .P .PD Retrieves the timeout for non blocking calls in milliseconds. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_CHARSET_INFO\f[R] .PD 0 .P .PD Retrieves character set information for given connection. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_CLIENT_CAPABILITIES\f[R] .PD 0 .P .PD Returns the capability flags of the client. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_ERROR\f[R] .PD 0 .P .PD Retrieves error message for last used command. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_ERROR_ID\f[R] .PD 0 .P .PD Retrieves error number for last used command. *\f[CR]MARIADB_CONNECTION_EXTENDED_SERVER_CAPABILITIES\f[R] .PD 0 .P .PD Returns the extended capability flags of the connected MariaDB server .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_HOST\f[R] .PD 0 .P .PD Returns host name of the connected MariaDB server .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_INFO\f[R] .PD 0 .P .PD Retrieves generic info for last used command. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_PORT\f[R] .PD 0 .P .PD Retrieves the port number of server host. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_PROTOCOL_VERSION_ID\f[R] .PD 0 .P .PD Retrieves the protocol version number. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_PVIO_TYPE\f[R] .PD 0 .P .PD Retrieves the pvio plugin used for specified connection. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SCHEMA\f[R] .PD 0 .P .PD Retrieves the current schema. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SERVER_CAPABILITIES\f[R] .PD 0 .P .PD Retrievrs the capability flags of the connected server. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SERVER_STATUS\f[R] .PD 0 .P .PD Returns server status after last operation. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SERVER_TYPE\f[R] .PD 0 .P .PD Retrieves the type of the server. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SERVER_VERSION\f[R] .PD 0 .P .PD Retrieves the server version in literal format. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SERVER_VERSION_ID\f[R] .PD 0 .P .PD Retrieves the server version in numeric format. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SOCKET\f[R] .PD 0 .P .PD Retrieves the handle (socket) for given connection. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SQLSTATE\f[R] .PD 0 .P .PD Retrieves current sqlstate information for last used command. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_SSL_CIPHER\f[R] .PD 0 .P .PD Retrieves the TLS/SSL cipher in use. .IP \[bu] 2 \f[CR]MARIADB_TLS_LIBRARY\f[R] .PD 0 .P .PD Retrieves the name of TLS library. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_TLS_VERSION\f[R] .PD 0 .P .PD Retrieves the TLS protocol version used in literal format. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_TLS_VERSION_ID\f[R] .PD 0 .P .PD Retrieves the TLS protocol version used in numeric format. .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_UNIX_SOCKET\f[R] .PD 0 .P .PD Retrieves the file name of the unix socket .IP \[bu] 2 \f[CR]MARIADB_CONNECTION_USER\f[R] .PD 0 .P .PD Retrieves connection\[cq]s user name. .IP \[bu] 2 \f[CR]MARIADB_TLS_PEER_CERT_INFO\f[R] Retrieves peer certificate information for TLS connections. The returned pointer to a MARIADB_X509_INFO structure becomes invalid after the connection has been closed. (Added in version 3.4.0) .IP \[bu] 2 \f[CR]MARIADB_TLS_VERIFY_STATUS\f[R] Retrieves the status of a previous peer certificate verification. The status is represented as a combination of TLS verification flags. This option was added in version 3.4.1 .SS Returns Returns zero on success, non zero if an error occurred (e.g.\ if an invalid option was specified), .SS Source file \f[CR]libmariadb/mariadb_lib.c\f[R] .SS History This function was added in MariaDB Connector/C 3.0, .SS Examples .IP .EX /* get server port for current connection */ unsigned int port; mariadb_get_infov(mysql, MARIADB_CONNECTION_PORT, (void *)&port); .EE .IP .EX /* get user name for current connection */ const char *user; mariadb_get_infov(mysql, MARIADB_CONNECTION_USER, (void *)&user); .EE .SS See also .IP \[bu] 2 \f[B]mysql_get_optionv(3)\f[R]