From 0fced163a3109ce70bd2f22214b709f5cf67adee Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Wed, 22 Dec 2021 15:22:31 +0000 Subject: [PATCH] Quote references to the user table in consistency checks (#18072) Backport #18072 Although #17487 ensured that the table was quoted in the join it missed that the query part of the check also needed to be quoted. Fix #17485 Signed-off-by: Andrew Thornton --- modules/doctor/dbconsistency.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go index 0dadf22be9c90..4f6db760fa06f 100644 --- a/modules/doctor/dbconsistency.go +++ b/modules/doctor/dbconsistency.go @@ -159,13 +159,13 @@ func checkDBConsistency(logger log.Logger, autofix bool) error { "lfs_lock", "repository", "lfs_lock.repo_id=repository.id"), // find collaborations without users genericOrphanCheck("Collaborations without existing user", - "collaboration", "user", "collaboration.user_id=user.id"), + "collaboration", "user", "collaboration.user_id=`user`.id"), // find collaborations without repository genericOrphanCheck("Collaborations without existing repository", "collaboration", "repository", "collaboration.repo_id=repository.id"), // find access without users genericOrphanCheck("Access entries without existing user", - "access", "user", "access.user_id=user.id"), + "access", "user", "access.user_id=`user`.id"), // find access without repository genericOrphanCheck("Access entries without existing repository", "access", "repository", "access.repo_id=repository.id"),