Skip to content

Commit 145fb48

Browse files
committed
try to fix flaky mysql test
1 parent 5410305 commit 145fb48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/db/collation.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ func CheckCollations(x *xorm.Engine) (*CheckCollationsResult, error) {
6868

6969
var candidateCollations []string
7070
if x.Dialect().URI().DBType == schemas.MYSQL {
71-
if _, err = x.SQL("SELECT @@collation_database").Get(&res.DatabaseCollation); err != nil {
71+
_, err = x.SQL("SELECT DEFAULT_COLLATION_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '?'", setting.Database.Name).Get(&res.DatabaseCollation)
72+
if err != nil {
7273
return nil, err
7374
}
7475
res.IsCollationCaseSensitive = func(s string) bool {

0 commit comments

Comments
 (0)