[PR #2092] [MERGED] Fix SQL bug in models.PullRequests #16226

Closed
opened 2025-11-02 12:05:21 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2092
Author: @ethantkoenig
Created: 7/1/2017
Status: Merged
Merged: 7/1/2017
Merged by: @lafriks

Base: masterHead: fix/pull_api


📝 Commits (1)

  • bc1aec9 Fix SQL bug in models.PullRequests

📊 Changes

2 files changed (+32 additions, -2 deletions)

View changed files

integrations/api_pull_test.go (+31 -0)
📝 models/pull.go (+1 -2)

📄 Description

Fixes the GET /repos/:owner/:repo/pulls API endpoint, which previously gave a 500 on Postgres.

Postgres doesn't like ORDER BY clauses in SELECT COUNT(*) ... queries.

Also add an integration test.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2092 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 7/1/2017 **Status:** ✅ Merged **Merged:** 7/1/2017 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `fix/pull_api` --- ### 📝 Commits (1) - [`bc1aec9`](https://github.com/go-gitea/gitea/commit/bc1aec9857d463df3ee62aa796eb1794b8191cec) Fix SQL bug in models.PullRequests ### 📊 Changes **2 files changed** (+32 additions, -2 deletions) <details> <summary>View changed files</summary> ➕ `integrations/api_pull_test.go` (+31 -0) 📝 `models/pull.go` (+1 -2) </details> ### 📄 Description Fixes the `GET /repos/:owner/:repo/pulls` API endpoint, which previously gave a 500 on Postgres. Postgres doesn't like `ORDER BY` clauses in `SELECT COUNT(*) ...` queries. Also add an integration test. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:05:21 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16226