diff --git a/maxscale-system-test/mxs1743_rconn_bitmask.cpp b/maxscale-system-test/mxs1743_rconn_bitmask.cpp index 949783662..4543e37cd 100644 --- a/maxscale-system-test/mxs1743_rconn_bitmask.cpp +++ b/maxscale-system-test/mxs1743_rconn_bitmask.cpp @@ -44,9 +44,11 @@ int main(int argc, char** argv) for (int i = 0; i < 20; i++) { - connections.push_back(open_conn(test.maxscales->readconn_master_port[0], - test.maxscales->IP[0], "mxs1743", - "mxs1743", false)); + // Open a connection and make sure it works + MYSQL* conn = open_conn(test.maxscales->readconn_master_port[0], test.maxscales->IP[0], + "mxs1743", "mxs1743", false); + test.try_query(conn, "SELECT 1"); + connections.push_back(conn); } // Give the connections a few seconds to establish diff --git a/server/modules/routing/readconnroute/readconnroute.c b/server/modules/routing/readconnroute/readconnroute.c index 278c65d24..1987fb38e 100644 --- a/server/modules/routing/readconnroute/readconnroute.c +++ b/server/modules/routing/readconnroute/readconnroute.c @@ -344,7 +344,7 @@ newSession(MXS_ROUTER *instance, MXS_SESSION *session) continue; } - if (ref == master_host && (inst->bitvalue & SERVER_MASTER)) + if (ref == master_host && inst->bitvalue == SERVER_MASTER) { /* If option is "master" return only the root Master as there could be * intermediate masters (Relay Servers) and they must not be selected.