Skip to content

Error 500 when visit /issues and /pulls (too many SQL variables) #7750

@ghost

Description

routers/user/home.go:269:Issues() [E] CountIssuesByRepo: too many SQL variables

Description

The above error should be able to explain this issue.

gitea/models/issue.go

Lines 1357 to 1366 in cd238bc

if len(opts.IssueIDs) > 0 {
sess.In("issue.id", opts.IssueIDs)
}
if len(opts.RepoIDs) > 0 {
// In case repository IDs are provided but actually no repository has issue.
sess.In("issue.repo_id", opts.RepoIDs)
}

gitea/models/issue.go

Lines 1649 to 1658 in cd238bc

case FilterModeAll:
stats.OpenCount, err = x.Where(cond).And("is_closed = ?", false).
And(builder.In("issue.repo_id", opts.UserRepoIDs)).
Count(new(Issue))
if err != nil {
return nil, err
}
stats.ClosedCount, err = x.Where(cond).And("is_closed = ?", true).
And(builder.In("issue.repo_id", opts.UserRepoIDs)).
Count(new(Issue))

gitea/models/issue.go

Lines 1708 to 1710 in cd238bc

stats.YourRepositoriesCount, err = x.Where(cond).
And(builder.In("issue.repo_id", opts.UserRepoIDs)).
Count(new(Issue))

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/confirmedIssue has been reviewed and confirmed to be present or accepted to be implementedtype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions