diff --git a/lib/MySQL_Monitor.cpp b/lib/MySQL_Monitor.cpp index 5bb98446f2..32acbf9d98 100644 --- a/lib/MySQL_Monitor.cpp +++ b/lib/MySQL_Monitor.cpp @@ -317,14 +317,16 @@ MYSQL * MySQL_Monitor_Connection_Pool::get_connection(char *hostname, int port, break; } #ifdef DEBUG - for (unsigned int j=0; jlen; j++) { - MYSQL *my1 = (MYSQL *)conns->index(j); - assert(my!=my1); - assert(my->net.fd!=my1->net.fd); - } - //proxy_info("Registering MYSQL with FD %d from mmsd %p and MYSQL %p\n", my->net.fd, mmsd, my); - if (my) + if (my) { + for (unsigned int j=0; jlen; j++) { + MYSQL *my1 = (MYSQL *)conns->index(j); + assert(my!=my1); + assert(my->net.fd!=my1->net.fd); + } + //proxy_info("Registering MYSQL with FD %d from mmsd %p and MYSQL %p\n", my->net.fd, mmsd, my); + conns->add(my); + } #endif // DEBUG } #ifdef DEBUG