MXS-2007: Check for no rows

If the query returns no rows, a NULL row is returned.
This commit is contained in:
Markus Mäkelä 2018-08-11 23:33:48 +03:00
parent 66061be58b
commit f499b22a9e
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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;
}