mariadb_get_infov

You are viewing an old version of this article. View the current version here.

Syntax

int mariadb_get_infov(MYSQL * mysql,
                      enum mariadb_value value,
                      void * arg,
                      ...);
  • mysql - a mysql handle, which was previously allocated by mysql_init() or mysql_real_connect(). For general : information which is not bound to connection this parameter might be null.
  • value - the type of value you want to retrieve. See description below.
  • arg - pointer to a variable for storing value of the specified option.
  • ... - variable argument list

Description

Retrieves generic or connection specific information.

Returns zero on success, non zero if an error occurred (invalid option)

This function was added in MariaDB Connector/C 3.0

Value types

Generic information

For these information types parameter mysql needs to be set to NULL.

  • MARIADB_MAX_ALLOWED_PACKET: Retrieves value of maximum allowed packet size.
size_t max_allowed_packet= 0;
mariadb_get_infov(NULL, MARIADB_MAX_ALLOWED_PACKET, (void *)&max_allowed_packet);
  • MARIADB_NET_BUFFER_LENGTH: Retrieves the length of net buffer.
size_t net_buffer_length= 0;
mariadb_get_infov(NULL, MARIADB_NET_BUFFER_LENGTH, (void *)&net_buffer_length);
  • MARIADB_CHARSET_NAME: Retrieves the charset information for a character set by it's literal representation.
const CHARSET_INFO *cs_info;
mariadb_get_infov(NULL, MARIADB_CHARSET_NAME, (void *)&cs_info, "utf8")
*##MARIADB_CHARSET_NAME##: Retrieves the charset information for a character set by it's literal representation.
const CHARSET_INFO *cs_info;
mariadb_get_infov(NULL, MARIADB_CHARSET_NAME, (void *)&cs_info, 64);
  • 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).
const char **errmg;
mariadb_get_infov(NULL, MARIADB_CLIENT_ERRORS, (void *)&errmsg);
  • MARIADB_SSL_LIBRARY: The SSL library MariaDB Connector/C is compiled against.
const char *ssl_lib;
mariadb_get_infov(NULL, MARIADB_SSL_LIBRARY, (void *)&ssl_lib);
  • MARIADB_CLIENT_VERSION: The client version in literal representation.
const char *client_version;
mariadb_get_infov(NULL, MARIADB_CLIENT_VERSION, (void *)&client_version);
  • MARIADB_CLIENT_VERSION_ID: The client version in numeric format.
unsigned int client_version;
mariadb_get_infov(NULL, MARIADB_CLIENT_VERSION_ID, (void *)&client_version);
  • MARIADB_CONNECTION_ASYNC_TIMEOUT: Retrieves the timeout for non blocking calls in seconds
unsigned int timeout;
mariadb_get_infov(mysql, MARIADB_CONNECTION_ASYNC_TIMEOUT, (void *)&timeout);
  • MARIADB_CONNECTION_ASYNC_TIMEOUT_MS: Retrieves the timeout for non blocking calls in milliseconds
unsigned int timeout_ms;
mariadb_get_infov(mysql, MARIADB_CONNECTION_ASYNC_TIMEOUT_MS, (void *)&timeout_ms);
  • MARIADB_CONNECTION_CHARSET_INFO: Retrieves character set information for given connection
const MY_CHARSET_INFO *cs_info
mariadb_get_infov(mysql, MARIADB_CONNECTION_CHARSET_INFO, (void *)&cs_info);
  • MARIADB_CONNECTION_ERROR: Retrieves error message for last used command
const char *error_msg;
mariadb_get_infov(mysql, MARIADB_CONNECTION_ERROR, (void *)&error_msg);
  • MARIADB_CONNECTION_ERROR_ID: Retrieves error number for last used command
unsigned int error_number;
mariadb_get_infov(mysql, MARIADB_CONNECTION_ERROR_ID, (void *)&error_number);
  • MARIADB_CONNECTION_HOST: Retrieves connection's host name
const char *hostname;
mariadb_get_infov(mysql, MARIADB_CONNECTION_HOST, (void *)&hostname);
  • MARIADB_CONNECTION_INFO: Retrieves generic info for last used command.
const char *info;
mariadb_get_infov(mysql, MARIADB_CONNECTION_INFO, (void *)&info);
  • MARIADB_CONNECTION_PORT: Retrieves the port number of server host
unsigned int port;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PORT, void *)&port);
  • MARIADB_CONNECTION_PROTOCOL_VERSION_ID: Retrieves the protocol version number
unsigned int protocol_version;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PROTOCOL_VERSION, (void *)&protocol_version);
  • MARIADB_CONNECTION_PVIO_TYPE: Retrives the pvio plugin used for specified connection.
unsigned int pvio_type;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PVIO_TYPE, (void *)&pvio_type);
  • MARIADB_CONNECTION_SCHEMA: Retrieves the current schema.
const char *schema;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SCHEMA, (void *)&schema);
  • MARIADB_CONNECTION_SERVER_TYPE: Retrieves the type of the server.
const char *server_type; /* MariaDB or MySQL */
mariadb_get_infov(mysql, MARIADB_CONNECTION_SERVER_TYPE, (void *)&server_type);
  • MARIADB_CONNECTION_SERVER_VERSION: Retrieves the server version in literal format
const char *server_version;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SERVER_VERSION, (void *)&server_version);
  • MARIADB_CONNECTION_SERVER_VERSION_ID: Retrieves the server version in numeric format
unsigned int server_version;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SERVER_VERSION_ID, (void *)&server_version);
  • MARIADB_CONNECTION_SOCKET: Retrieves the handle (socket) for given connection
my_socket sock;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SOCKET, (void *)&sock);
  • MARIADB_CONNECTION_SQLSTATE: Retrieves current sqlstate information for last used command
const char *sqlstate;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SQLSTATE, (void *)&sqlstate);
  • MARIADB_CONNECTION_SSL_CIPHER: Retrieves the ssl cipther in use.
const char *cipher;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SSL_CIPHER, (void *)&cipher);
  • MARIADB_CONNECTION_SSL_VERSION: Retrieves the SSL protocol version used in literal format.
char *ssl_version;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SSL_VERSION, (void *)&ssl_version);
  • MARIADB_CONNECTION_SSL_VERSION_ID: Retrieves the SSL protocol version used in numeric format
unsigned int ssl_version;
mariadb_get_infov(mysql, MARIADB_CONNECTION_SSL_VERSION_ID, (void *)&ssl_version);
  • MARIADB_CONNECTION_PVIO_TYPE: Retrieves the type of the pvio plugin in use
unsigned int pvio_type;
mariadb_get_infov(mysql, MARIADB_CONNECTION_PVIO_TYPE, (void *)&pvio_type);
  • MARIADB_CONNECTION_UNIX_SOCKET: Retrieves the file name of the unix socket
const char *unix_socket;
mariadb_get_infov(mysql, MARIADB_CONNECTION_UNIX_SOCKET, (void *)&unix_socket);
  • MARIADB_CONNECTION_USER: Retrieves connection's user name
const char *user;
mariadb_get_infov(mysql, MARIADB_CONNECTION_USER, (void *)&user);

See also

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.