Replace dots with an underscore when creating an alias for the recursive CTE
requested to merge 8798-geo-implement-selective-sync-support-for-the-various-fdw-queries into master
What does this MR do?
CE port of https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/9445. When the Arel table to use as the alias contains a schema in your name, e.g., "gitlab_secondary"."namespaces" it produces an invalid query.
What are the relevant issue numbers?
#8798.