MXS-1367: Take mxs_mysql_query into use

The use of a wrapper function allows automated retrying of the queries
without requiring any changes to the code that uses it.
This commit is contained in:
Markus Mäkelä
2017-10-03 01:52:54 +03:00
parent f1f8a4b5b2
commit 67ef7bd058
8 changed files with 50 additions and 45 deletions

View File

@ -23,6 +23,7 @@
#include <mysqld_error.h>
#include <maxscale/alloc.h>
#include <maxscale/debug.h>
#include <maxscale/mysql_utils.h>
typedef struct aurora_monitor
{
@ -59,9 +60,9 @@ void update_server_status(MXS_MONITOR *monitor, MXS_MONITOR_SERVERS *database)
MYSQL_RES *result;
/** Connection is OK, query for replica status */
if (mysql_query(database->con, "SELECT @@aurora_server_id, server_id FROM "
"information_schema.replica_host_status "
"WHERE session_id = 'MASTER_SESSION_ID'") == 0 &&
if (mxs_mysql_query(database->con, "SELECT @@aurora_server_id, server_id FROM "
"information_schema.replica_host_status "
"WHERE session_id = 'MASTER_SESSION_ID'") == 0 &&
(result = mysql_store_result(database->con)))
{
ss_dassert(mysql_field_count(database->con) == 2);