Fix bug where database names with dots would get improperly quoted.

A sample DB name of part1.part2 would be quoted as [part1].[part2] instead of [part1.part2]