A follow up for a more complete fix of #11799 ... Which still has issues if a user doesn't have a default DB specified.
The sync should fail immediately by calling select database() and checking if the result is a non null value.
This would be a breaking change as it would require users to either specify a default DB at the user level in the DB or specify a db in the connection string