Fixed reconnect logic in MySQL adapter, added test