Skip to content

postgresql error: multiple assignments to same column "num_issues" #8336

Closed
@yzzyx

Description

@yzzyx
  • Gitea version (or commit ref): 1.10.0+dev-344-g8a45070f6
  • Git version: 2.22.0
  • Operating system: linux
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When adding/removing a label on an issue, nothing happens on the frontend.
In postgresql the following error is logged:

ERROR:  multiple assignments to same column "num_issues"
STATEMENT:  UPDATE "label" SET "repo_id" = $1, "name" = $2, "description" = $3, "color" = $4, "num_issues" = $5, "num_closed_issues" = $6, "query_string" = $7, "is_se    lected" = $8, "num_issues" = (SELECT count(*) FROM issue_label WHERE label_id=$9), "num_closed_issues" = (SELECT count(*) FROM issue_label INNER JOIN issue ON issue_label.issue_i    d = issue.id WHERE issue.is_closed=$10 AND issue_label.label_id=$11) WHERE "id"=$12

When clicking close or comment and close on an issue with an existing label, the issue is not closed because of the same bug.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions