Fixed Default Database Switching on Client Reconnection

Fixed switching to the default database when reconnecting the client (#2583).