Classes | |
struct | drizzle_con_tcp_st |
struct | drizzle_con_uds_st |
struct | drizzle_con_st |
Modules | |
Static Connection Declarations | |
Local Connection Declarations | |
Enumerations | |
enum | drizzle_con_options_t { DRIZZLE_CON_NONE = 0, DRIZZLE_CON_ALLOCATED = (1 << 0), DRIZZLE_CON_MYSQL = (1 << 1), DRIZZLE_CON_RAW_PACKET = (1 << 2), DRIZZLE_CON_RAW_SCRAMBLE = (1 << 3), DRIZZLE_CON_READY = (1 << 4), DRIZZLE_CON_NO_RESULT_READ = (1 << 5), DRIZZLE_CON_IO_READY = (1 << 6), DRIZZLE_CON_LISTEN = (1 << 7), DRIZZLE_CON_EXPERIMENTAL = (1 << 8), DRIZZLE_CON_FOUND_ROWS = (1 << 9), DRIZZLE_CON_ADMIN = (1 << 10), DRIZZLE_CON_INTERACTIVE = (1 << 11), DRIZZLE_CON_MULTI_STATEMENTS = (1 << 12), DRIZZLE_CON_AUTH_PLUGIN = (1 << 13) } |
enum | drizzle_con_socket_t { DRIZZLE_CON_SOCKET_TCP = 0, DRIZZLE_CON_SOCKET_UDS = (1 << 0) } |
enum | drizzle_con_status_t { DRIZZLE_CON_STATUS_NONE = 0, DRIZZLE_CON_STATUS_IN_TRANS = (1 << 0), DRIZZLE_CON_STATUS_AUTOCOMMIT = (1 << 1), DRIZZLE_CON_STATUS_MORE_RESULTS_EXISTS = (1 << 3), DRIZZLE_CON_STATUS_QUERY_NO_GOOD_INDEX_USED = (1 << 4), DRIZZLE_CON_STATUS_QUERY_NO_INDEX_USED = (1 << 5), DRIZZLE_CON_STATUS_CURSOR_EXISTS = (1 << 6), DRIZZLE_CON_STATUS_LAST_ROW_SENT = (1 << 7), DRIZZLE_CON_STATUS_DB_DROPPED = (1 << 8), DRIZZLE_CON_STATUS_NO_BACKSLASH_ESCAPES = (1 << 9), DRIZZLE_CON_STATUS_QUERY_WAS_SLOW = (1 << 10) } |
enum | drizzle_capabilities_t { DRIZZLE_CAPABILITIES_NONE = 0, DRIZZLE_CAPABILITIES_LONG_PASSWORD = (1 << 0), DRIZZLE_CAPABILITIES_FOUND_ROWS = (1 << 1), DRIZZLE_CAPABILITIES_LONG_FLAG = (1 << 2), DRIZZLE_CAPABILITIES_CONNECT_WITH_DB = (1 << 3), DRIZZLE_CAPABILITIES_NO_SCHEMA = (1 << 4), DRIZZLE_CAPABILITIES_COMPRESS = (1 << 5), DRIZZLE_CAPABILITIES_ODBC = (1 << 6), DRIZZLE_CAPABILITIES_LOCAL_FILES = (1 << 7), DRIZZLE_CAPABILITIES_IGNORE_SPACE = (1 << 8), DRIZZLE_CAPABILITIES_PROTOCOL_41 = (1 << 9), DRIZZLE_CAPABILITIES_INTERACTIVE = (1 << 10), DRIZZLE_CAPABILITIES_SSL = (1 << 11), DRIZZLE_CAPABILITIES_IGNORE_SIGPIPE = (1 << 12), DRIZZLE_CAPABILITIES_TRANSACTIONS = (1 << 13), DRIZZLE_CAPABILITIES_RESERVED = (1 << 14), DRIZZLE_CAPABILITIES_SECURE_CONNECTION = (1 << 15), DRIZZLE_CAPABILITIES_MULTI_STATEMENTS = (1 << 16), DRIZZLE_CAPABILITIES_MULTI_RESULTS = (1 << 17), DRIZZLE_CAPABILITIES_PS_MULTI_RESULTS = (1 << 18), DRIZZLE_CAPABILITIES_PLUGIN_AUTH = (1 << 19), DRIZZLE_CAPABILITIES_ADMIN = (1 << 25), DRIZZLE_CAPABILITIES_SSL_VERIFY_SERVER_CERT = (1 << 30), DRIZZLE_CAPABILITIES_REMEMBER_OPTIONS = (1 << 31), DRIZZLE_CAPABILITIES_CLIENT } |
Functions | |
DRIZZLE_API int | drizzle_con_fd (const drizzle_con_st *con) |
DRIZZLE_API drizzle_return_t | drizzle_con_set_fd (drizzle_con_st *con, int fd) |
DRIZZLE_API void | drizzle_con_close (drizzle_con_st *con) |
DRIZZLE_API drizzle_return_t | drizzle_con_set_events (drizzle_con_st *con, short events) |
DRIZZLE_API drizzle_return_t | drizzle_con_set_revents (drizzle_con_st *con, short revents) |
DRIZZLE_API drizzle_st * | drizzle_con_drizzle (const drizzle_con_st *con) |
DRIZZLE_API const char * | drizzle_con_error (const drizzle_con_st *con) |
DRIZZLE_API int | drizzle_con_errno (const drizzle_con_st *con) |
DRIZZLE_API uint16_t | drizzle_con_error_code (const drizzle_con_st *con) |
DRIZZLE_API const char * | drizzle_con_sqlstate (const drizzle_con_st *con) |
DRIZZLE_API drizzle_con_options_t | drizzle_con_options (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_options (drizzle_con_st *con, drizzle_con_options_t options) |
DRIZZLE_API void | drizzle_con_add_options (drizzle_con_st *con, drizzle_con_options_t options) |
DRIZZLE_API void | drizzle_con_remove_options (drizzle_con_st *con, drizzle_con_options_t options) |
DRIZZLE_API const char * | drizzle_con_host (const drizzle_con_st *con) |
DRIZZLE_API in_port_t | drizzle_con_port (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_tcp (drizzle_con_st *con, const char *host, in_port_t port) |
DRIZZLE_API const char * | drizzle_con_uds (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_uds (drizzle_con_st *con, const char *uds) |
DRIZZLE_API const char * | drizzle_con_user (const drizzle_con_st *con) |
DRIZZLE_API const char * | drizzle_con_password (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_auth (drizzle_con_st *con, const char *user, const char *password) |
DRIZZLE_API const char * | drizzle_con_db (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_db (drizzle_con_st *con, const char *db) |
DRIZZLE_API void * | drizzle_con_context (const drizzle_con_st *con) |
DRIZZLE_API void | drizzle_con_set_context (drizzle_con_st *con, void *context) |
DRIZZLE_API void | drizzle_con_set_context_free_fn (drizzle_con_st *con, drizzle_con_context_free_fn *function) |
DRIZZLE_API uint8_t | drizzle_con_protocol_version (const drizzle_con_st *con) |
DRIZZLE_API const char * | drizzle_con_server_version (const drizzle_con_st *con) |
DRIZZLE_API uint32_t | drizzle_con_server_version_number (const drizzle_con_st *con) |
DRIZZLE_API uint32_t | drizzle_con_thread_id (const drizzle_con_st *con) |
DRIZZLE_API const uint8_t * | drizzle_con_scramble (const drizzle_con_st *con) |
DRIZZLE_API drizzle_capabilities_t | drizzle_con_capabilities (const drizzle_con_st *con) |
DRIZZLE_API drizzle_charset_t | drizzle_con_charset (const drizzle_con_st *con) |
DRIZZLE_API drizzle_con_status_t | drizzle_con_status (const drizzle_con_st *con) |
DRIZZLE_API uint32_t | drizzle_con_max_packet_size (const drizzle_con_st *con) |
Capabilities for drizzle_con_st.
Definition at line 211 of file constants.h.
Options for drizzle_con_st.
Definition at line 159 of file constants.h.
enum drizzle_con_socket_t |
Socket types for drizzle_con_st.
Definition at line 182 of file constants.h.
enum drizzle_con_status_t |
Status flags for drizle_con_st.
Definition at line 192 of file constants.h.
DRIZZLE_API void drizzle_con_add_options | ( | drizzle_con_st * | con, |
drizzle_con_options_t | options | ||
) |
Add options for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | options | Available options for connection structure to set. |
Definition at line 191 of file conn.c.
Referenced by drizzle_con_accept(), drizzle_con_add_tcp(), drizzle_con_add_tcp_listen(), drizzle_con_add_uds(), and drizzle_con_add_uds_listen().
DRIZZLE_API drizzle_capabilities_t drizzle_con_capabilities | ( | const drizzle_con_st * | con | ) |
Get capabilities for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API drizzle_charset_t drizzle_con_charset | ( | const drizzle_con_st * | con | ) |
Get character set for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API void drizzle_con_close | ( | drizzle_con_st * | con | ) |
Close a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 84 of file conn.c.
References drizzle_state_reset().
Referenced by drizzle_con_free(), drizzle_con_set_events(), drizzle_con_set_revents(), and drizzle_state_loop().
DRIZZLE_API void* drizzle_con_context | ( | const drizzle_con_st * | con | ) |
Get application context pointer for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API const char* drizzle_con_db | ( | const drizzle_con_st * | con | ) |
Get database for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API drizzle_st* drizzle_con_drizzle | ( | const drizzle_con_st * | con | ) |
Get the drizzle_st struct that the connection belongs to.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API int drizzle_con_errno | ( | const drizzle_con_st * | con | ) |
Value of errno in the case of a DRIZZLE_RETURN_ERRNO return value.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 165 of file conn.c.
References drizzle_errno().
DRIZZLE_API const char* drizzle_con_error | ( | const drizzle_con_st * | con | ) |
Return an error string for last error encountered.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 160 of file conn.c.
References drizzle_error().
DRIZZLE_API uint16_t drizzle_con_error_code | ( | const drizzle_con_st * | con | ) |
Get server defined error code for the last result read.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 170 of file conn.c.
References drizzle_error_code().
DRIZZLE_API int drizzle_con_fd | ( | const drizzle_con_st * | con | ) |
Get file descriptor for connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API const char* drizzle_con_host | ( | const drizzle_con_st * | con | ) |
Get TCP host for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API uint32_t drizzle_con_max_packet_size | ( | const drizzle_con_st * | con | ) |
Get max packet size for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API drizzle_con_options_t drizzle_con_options | ( | const drizzle_con_st * | con | ) |
Get options for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API const char* drizzle_con_password | ( | const drizzle_con_st * | con | ) |
Get password for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API in_port_t drizzle_con_port | ( | const drizzle_con_st * | con | ) |
Get TCP port for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API uint8_t drizzle_con_protocol_version | ( | const drizzle_con_st * | con | ) |
Get protocol version for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API void drizzle_con_remove_options | ( | drizzle_con_st * | con, |
drizzle_con_options_t | options | ||
) |
Remove options for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | options | Available options for connection structure to remove. |
DRIZZLE_API const uint8_t* drizzle_con_scramble | ( | const drizzle_con_st * | con | ) |
Get scramble buffer for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API const char* drizzle_con_server_version | ( | const drizzle_con_st * | con | ) |
Get server version string for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API uint32_t drizzle_con_server_version_number | ( | const drizzle_con_st * | con | ) |
Get server version number for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API void drizzle_con_set_auth | ( | drizzle_con_st * | con, |
const char * | user, | ||
const char * | password | ||
) |
Set username and password for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | user | Username to use for this connection. |
[in] | password | Password to use for this connection. |
Definition at line 266 of file conn.c.
Referenced by drizzle_con_add_tcp(), drizzle_con_add_uds(), drizzle_con_copy_handshake(), and slave::QueueProducer::openConnection().
DRIZZLE_API void drizzle_con_set_context | ( | drizzle_con_st * | con, |
void * | context | ||
) |
Set application context pointer for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | context | Application context to use with this connection. |
DRIZZLE_API void drizzle_con_set_context_free_fn | ( | drizzle_con_st * | con, |
drizzle_con_context_free_fn * | function | ||
) |
Set callback function when the context pointer should be freed.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | function | Function to call to clean up connection context. |
DRIZZLE_API void drizzle_con_set_db | ( | drizzle_con_st * | con, |
const char * | db | ||
) |
Set database for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | db | Database to use with this connection. |
Definition at line 291 of file conn.c.
Referenced by drizzle_con_add_tcp(), drizzle_con_add_uds(), drizzle_con_copy_handshake(), and drizzle_con_select_db().
DRIZZLE_API drizzle_return_t drizzle_con_set_events | ( | drizzle_con_st * | con, |
short | events | ||
) |
Set events to be watched for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | events | Bitfield of poll() events to watch. |
Definition at line 102 of file conn.c.
References drizzle_con_close().
Referenced by drizzle_con_accept().
DRIZZLE_API drizzle_return_t drizzle_con_set_fd | ( | drizzle_con_st * | con, |
int | fd | ||
) |
Use given file descriptor for connction.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | fd | File descriptor for connection. |
Definition at line 71 of file conn.c.
References _con_setsockopt().
Referenced by drizzle_con_accept().
DRIZZLE_API void drizzle_con_set_options | ( | drizzle_con_st * | con, |
drizzle_con_options_t | options | ||
) |
Set options for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | options | Available options for connection structure to set. |
DRIZZLE_API drizzle_return_t drizzle_con_set_revents | ( | drizzle_con_st * | con, |
short | revents | ||
) |
Set events that are ready for a connection. This is used with the external event callbacks. See drizzle_set_event_watch_fn().
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | revents | Bitfield of poll() events that were detected. |
Definition at line 125 of file conn.c.
References drizzle_con_close().
Referenced by drizzle_con_wait().
DRIZZLE_API void drizzle_con_set_tcp | ( | drizzle_con_st * | con, |
const char * | host, | ||
in_port_t | port | ||
) |
Set TCP host and port for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | host | Host to use for this connection, NULL for default value. |
[in] | port | Port to use for this connection, 0 for default value. |
Definition at line 238 of file conn.c.
References drizzle_con_reset_addrinfo().
Referenced by drizzle_con_add_tcp(), drizzle_con_add_tcp_listen(), drizzle_con_clone(), and slave::QueueProducer::openConnection().
DRIZZLE_API void drizzle_con_set_uds | ( | drizzle_con_st * | con, |
const char * | uds | ||
) |
Set unix domain socket for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
[in] | uds | Unix domain socket to use for this connection, NULL for defailt value. |
Definition at line 60 of file conn_uds.c.
References drizzle_con_reset_addrinfo().
Referenced by drizzle_con_add_uds(), drizzle_con_add_uds_listen(), and drizzle_con_clone().
DRIZZLE_API const char* drizzle_con_sqlstate | ( | const drizzle_con_st * | con | ) |
Get SQL state code for the last result read.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 175 of file conn.c.
References drizzle_sqlstate().
DRIZZLE_API drizzle_con_status_t drizzle_con_status | ( | const drizzle_con_st * | con | ) |
Get status for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API uint32_t drizzle_con_thread_id | ( | const drizzle_con_st * | con | ) |
Get thread ID for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
DRIZZLE_API const char* drizzle_con_uds | ( | const drizzle_con_st * | con | ) |
Get unix domain socket for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |
Definition at line 44 of file conn_uds.c.
DRIZZLE_API const char* drizzle_con_user | ( | const drizzle_con_st * | con | ) |
Get username for a connection.
[in] | con | Connection structure previously initialized with drizzle_con_create(), drizzle_con_clone(), or related functions. |