-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MySQL/MariaDB: Unique Constraint on Branches doesn't respect casing: UQE_branch_s #28131
Comments
I got the same error in Gitea log after updating to 1.21. But I can't find such branch in DB. |
Related: #25909 |
Are we "allowed" to remove a unique constraint in a patch release? |
It helped: #25909 (comment) |
Anything reasonable is possible, but I think the solution is to make the field case-sensitive. |
For 1.21 (unlucky...) users, the workaround is to run the SQL manually:
It won't cause side-effect and won't conflict with the complete fix (if there is anything wrong, it could be revert to old |
…8662) Mainly for MySQL/MSSQL. It is important for Gitea to use case-sensitive database charset collation. If the database is using a case-insensitive collation, Gitea will show startup error/warning messages, and show the errors/warnings on the admin panel's Self-Check page. Make `gitea doctor convert` work for MySQL to convert the collations of database & tables & columns. * Fix #28131 ##⚠️ BREAKING⚠️ It is not quite breaking, but it's highly recommended to convert the database&table&column to a consistent and case-sensitive collation.
…-gitea#28662) Mainly for MySQL/MSSQL. It is important for Gitea to use case-sensitive database charset collation. If the database is using a case-insensitive collation, Gitea will show startup error/warning messages, and show the errors/warnings on the admin panel's Self-Check page. Make `gitea doctor convert` work for MySQL to convert the collations of database & tables & columns. * Fix go-gitea#28131 ##⚠️ BREAKING⚠️ It is not quite breaking, but it's highly recommended to convert the database&table&column to a consistent and case-sensitive collation.
…-gitea#28662) Mainly for MySQL/MSSQL. It is important for Gitea to use case-sensitive database charset collation. If the database is using a case-insensitive collation, Gitea will show startup error/warning messages, and show the errors/warnings on the admin panel's Self-Check page. Make `gitea doctor convert` work for MySQL to convert the collations of database & tables & columns. * Fix go-gitea#28131 ##⚠️ BREAKING⚠️ It is not quite breaking, but it's highly recommended to convert the database&table&column to a consistent and case-sensitive collation.
Description
In a repo with two branches
feature/test_case
andfeature\Test_Case
gitea throws a 500 exception when syncing branches as the unique constraint is violated.SyncRepoBranches: Error 1062 (23000): Duplicate entry '<redacted_branch_name>' for key 'UQE_branch_s'
This error happened after an upgrade to 1.21.0 on an existing repo.
Workaround is to rename one of the branches.
Typically having this type of different branch names only based on casing is not needed (imho it's a bug ;) ) - but we shouldn't have a 500 page when accessing the repo.
Gitea Version
1.21.0
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
Linux
How are you running Gitea?
Official binary
Database
MySQL/MariaDB
The text was updated successfully, but these errors were encountered: