Fix `Routable.find_by_full_path` on MySQL
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/31908. I've also picked this into https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1838.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/31908. I've also picked this into https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/1838.