mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 14:43:52 +03:00
Backport #28546 by @lunny
Fixes #28155
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
(cherry picked from commit 6493085aee
)
This commit is contained in:
parent
70c7ee5475
commit
a23ccd2d93
1 changed files with 6 additions and 3 deletions
|
@ -446,8 +446,11 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, int64, err
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
sess := db.GetEngine(ctx).Where(cond).
|
sess := db.GetEngine(ctx).Where(cond)
|
||||||
Select("`action`.*"). // this line will avoid select other joined table's columns
|
if setting.Database.Type.IsMySQL() {
|
||||||
|
sess = sess.IndexHint("USE", "JOIN", "IDX_action_c_u_d")
|
||||||
|
}
|
||||||
|
sess = sess.Select("`action`.*"). // this line will avoid select other joined table's columns
|
||||||
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
|
Join("INNER", "repository", "`repository`.id = `action`.repo_id")
|
||||||
|
|
||||||
opts.SetDefaultValues()
|
opts.SetDefaultValues()
|
||||||
|
|
Loading…
Reference in a new issue