fix: use READ COMMITTED transactions on MySQL and MariaDB (#39506) (#39537)

Backport #39506 by @silverwind

MariaDB 11.6.2+ defaults `innodb_snapshot_isolation` to `ON`, which
fails REPEATABLE READ transactions with error 1020 when a row they write
changed after their first read. Gitea's background work like push
processing writes the same rows, so merges, issue closes and workflow
runs fail sporadically.

- Use READ COMMITTED on MySQL and MariaDB, like PostgreSQL and MSSQL
- Update xorm to v1.4.3

Replaces: https://github.com/go-gitea/gitea/pull/39494
Fixes: https://github.com/go-gitea/gitea/issues/39492

Signed-off-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
Giteabotandsilverwind authored and GitHub committed 2026-10-01 14:19:32 -07:00
1 parent 565957503c
commit 4c3df3ab3c
3 files changed
+9 -3

No files matched your search

+1 -1
View File
@@ -109,7 +109,7 @@ require (
modernc.org/sqlite v1.59.0
mvdan.cc/xurls/v2 v2.6.0
xorm.io/builder v0.3.13
xorm.io/xorm v1.4.1
xorm.io/xorm v1.4.3
)
require (