diff options
author | Giteabot <teabot@gitea.io> | 2023-09-24 05:15:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-23 21:15:05 +0000 |
commit | 64c0a6a4e2654bde9ad25eb8658e1cebd1282c6c (patch) | |
tree | 85fd387380ea6ef837e22a94b1ada6da119eccd9 /modules/doctor | |
parent | 2181b3713e81de95b56458cc46d5f64ccb4f84b7 (diff) | |
download | gitea-64c0a6a4e2654bde9ad25eb8658e1cebd1282c6c.tar.gz gitea-64c0a6a4e2654bde9ad25eb8658e1cebd1282c6c.zip |
Quote table `release` in sql queries (#27205) (#27218)
Backport #27205 by @KN4CK3R
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
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'modules/doctor')
-rw-r--r-- | modules/doctor/dbconsistency.go | 2 |
1 files changed, 1 insertions, 1 deletions
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"), |