aboutsummaryrefslogtreecommitdiffstats
path: root/models/db
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-11-17 21:59:04 -0800
committerGitHub <noreply@github.com>2024-11-18 05:59:04 +0000
commit696fbe60365d59a2d979f977b5ae6f13c52f9188 (patch)
treed79af3d789fb1874dbdd10afdc0a4906f0a621b3 /models/db
parent8a20fba8eb1ac01a0de9355eff84af69d4636d96 (diff)
downloadgitea-696fbe60365d59a2d979f977b5ae6f13c52f9188.tar.gz
gitea-696fbe60365d59a2d979f977b5ae6f13c52f9188.zip
Refactor push mirror find and add check for updating push mirror (#32539)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/db')
-rw-r--r--models/db/collation.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/db/collation.go b/models/db/collation.go
index c128cf5029..a7db9f5442 100644
--- a/models/db/collation.go
+++ b/models/db/collation.go
@@ -68,7 +68,8 @@ func CheckCollations(x *xorm.Engine) (*CheckCollationsResult, error) {
var candidateCollations []string
if x.Dialect().URI().DBType == schemas.MYSQL {
- if _, err = x.SQL("SELECT @@collation_database").Get(&res.DatabaseCollation); err != nil {
+ _, err = x.SQL("SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ?", setting.Database.Name).Get(&res.DatabaseCollation)
+ if err != nil {
return nil, err
}
res.IsCollationCaseSensitive = func(s string) bool {