Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search returns 500 error with MSSQL #5148

Closed
2 of 6 tasks
izzor opened this issue Oct 23, 2018 · 2 comments
Closed
2 of 6 tasks

Search returns 500 error with MSSQL #5148

izzor opened this issue Oct 23, 2018 · 2 comments
Labels
Milestone

Comments

@izzor
Copy link

izzor commented Oct 23, 2018

  • Gitea version (or commit ref): 1.6
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • 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:
    [2018/10/23 09:58:55 [I] [SQL] SELECT TOP 20 repository.* FROM "repository" LEFT JOIN repo_topic ON repo_topic.repo_id = repository.id LEFT JOIN topic ON repo_topic.topic_id = topic.id WHERE (owner_id=? OR ((repository.id IN (SELECT repo_id FROM "access" WHERE access.user_id = ?)) AND owner_id<>?) OR is_private=?) AND (lower_name LIKE ? OR topic.name LIKE ?) GROUP BY repository.id ORDER BY repository.updated_unix DESC []interface {}{2, 2, 2, false, "%foobar%", "%foobar%"}]
    [2018/10/23 09:58:55 [...itea/routers/home.go:138 RenderRepoSearch()] [E] SearchRepositoryByName: Repo: mssql: Column 'repository.owner_id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.]

Description

When using the search field under Explore / Repositories I get a 500, Internal Server Error. I checked the log files and found the query causing the error.
In MS SQL Server all columns must be specified in the Group By clause. MySQL allows it but I guess it may be a problem with other database dialects as well.

@lunny lunny added the type/bug label Oct 23, 2018
@alexmejiaec
Copy link

bump

@lunny
Copy link
Member

lunny commented Oct 24, 2018

#5136 will try to fix this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants