summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2022-05-09 23:19:16 +0800
committerGitHub <noreply@github.com>2022-05-09 23:19:16 +0800
commite435283c0ffe437f35898f92dc5572c8df83163e (patch)
treeaa612897c0306fd75728c528638d4b32f781d4e6 /models
parentcd99540cdcb38f53c7329218d3a21ed974f520c2 (diff)
downloadgitea-e435283c0ffe437f35898f92dc5572c8df83163e.tar.gz
gitea-e435283c0ffe437f35898f92dc5572c8df83163e.zip
Don't select join table's columns (#19660)
* Don't select join table * Add comment
Diffstat (limited to 'models')
-rw-r--r--models/action.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index efbe243bed..7055ce81d6 100644
--- a/models/action.go
+++ b/models/action.go
@@ -340,7 +340,9 @@ func GetFeeds(ctx context.Context, opts GetFeedsOptions) (ActionList, error) {
}
e := db.GetEngine(ctx)
- sess := e.Where(cond).Join("INNER", "repository", "`repository`.id = `action`.repo_id")
+ sess := e.Where(cond).
+ Select("`action`.*"). // this line will avoid select other joined table's columns
+ Join("INNER", "repository", "`repository`.id = `action`.repo_id")
opts.SetDefaultValues()
sess = db.SetSessionPagination(sess, &opts)