From bcb78e70ca81293a705b467e9ce2b77ab04a799e Mon Sep 17 00:00:00 2001 From: KN4CK3R Date: Sat, 23 Sep 2023 14:57:39 +0200 Subject: Quote table `release` in sql queries (#27205) Fixes #27174 `release` is a reserved keyword in MySql. I can't reproduce the issue on my setup and we have a test for that code but it seems there can be setups where it fails. https://github.com/go-gitea/gitea/blob/a101dbaa7952e359843c6d8303ca24a0e63c865c/tests/integration/repo_activity_test.go#L45-L46 --- modules/doctor/dbconsistency.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/doctor/dbconsistency.go') diff --git a/modules/doctor/dbconsistency.go b/modules/doctor/dbconsistency.go index 541fc736f4..5486873556 100644 --- a/modules/doctor/dbconsistency.go +++ b/modules/doctor/dbconsistency.go @@ -101,7 +101,7 @@ func checkDBConsistency(ctx context.Context, logger log.Logger, autofix bool) er }, // find releases without existing repository genericOrphanCheck("Orphaned Releases without existing repository", - "release", "repository", "release.repo_id=repository.id"), + "release", "repository", "`release`.repo_id=repository.id"), // find pulls without existing issues genericOrphanCheck("Orphaned PullRequests without existing issue", "pull_request", "issue", "pull_request.issue_id=issue.id"), -- cgit v1.2.3