MXS-2276 Expose lower level mon_ping_or_connect_to_db
The functionality is useful also when you do not have a MXS_MONITORED_SERVER instance.
This commit is contained in:
@ -317,7 +317,30 @@ void monitor_check_maintenance_requests(Monitor* monitor);
|
||||
bool mon_status_changed(MXS_MONITORED_SERVER* mon_srv);
|
||||
bool mon_print_fail_status(MXS_MONITORED_SERVER* mon_srv);
|
||||
|
||||
/**
|
||||
* Ping or connect to a database. If connection does not exist or ping fails, a new connection
|
||||
* is created. This will always leave a valid database handle in @c *ppCon, allowing the user
|
||||
* to call MySQL C API functions to find out the reason of the failure.
|
||||
*
|
||||
* @param mon A monitor.
|
||||
* @param pServer A server.
|
||||
* @param ppCon Address of pointer to a MYSQL instance. The instance should either be
|
||||
* valid or NULL.
|
||||
* @return Connection status.
|
||||
*/
|
||||
mxs_connect_result_t mon_ping_or_connect_to_db(const Monitor& mon, SERVER& server, MYSQL** ppCon);
|
||||
|
||||
/**
|
||||
* Ping or connect to a database. If connection does not exist or ping fails, a new connection is created.
|
||||
* This will always leave a valid database handle in the database->con pointer, allowing the user to call
|
||||
* MySQL C API functions to find out the reason of the failure.
|
||||
*
|
||||
* @param mon Monitor
|
||||
* @param database Monitored database
|
||||
* @return Connection status.
|
||||
*/
|
||||
mxs_connect_result_t mon_ping_or_connect_to_db(Monitor* mon, MXS_MONITORED_SERVER* database);
|
||||
|
||||
bool mon_connection_is_ok(mxs_connect_result_t connect_result);
|
||||
void mon_log_connect_error(MXS_MONITORED_SERVER* database, mxs_connect_result_t rval);
|
||||
const char* mon_get_event_name(mxs_monitor_event_t event);
|
||||
|
Reference in New Issue
Block a user