From f499b22a9ef783de6ea0c47ee9d9d683768ad68c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Sat, 11 Aug 2018 23:33:48 +0300 Subject: [PATCH] MXS-2007: Check for no rows If the query returns no rows, a NULL row is returned. --- server/modules/monitor/auroramon/auroramon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/modules/monitor/auroramon/auroramon.c b/server/modules/monitor/auroramon/auroramon.c index a21965ec0..3bc705176 100644 --- a/server/modules/monitor/auroramon/auroramon.c +++ b/server/modules/monitor/auroramon/auroramon.c @@ -71,7 +71,7 @@ void update_server_status(MXS_MONITOR *monitor, MXS_MONITORED_SERVER *database) int status = SERVER_SLAVE; /** The master will return a row with two identical non-NULL fields */ - if (row[0] && row[1] && strcmp(row[0], row[1]) == 0) + if (row && row[0] && row[1] && strcmp(row[0], row[1]) == 0) { status = SERVER_MASTER; }