MSSQL rejects the query: SELECT "repository"."id" FROM "repository" INNER JOIN "team_repo" ON "team_repo".repo_id="repository".id AND "repository".is_mirror=1 WHERE ( ("repository".owner_id=2 AND "repository".is_private=0) OR team_repo.team_id IN (1) ) GROUP BY "repository".id ORDER BY updated_unix DESC when the order by term (updated_unix) is not included in the group by term.
This commit is contained in:
parent
5b36379172
commit
73ad7d2ef3
1 changed files with 1 additions and 1 deletions
|
@ -671,7 +671,7 @@ func (env *accessibleReposEnv) MirrorRepoIDs() ([]int64, error) {
|
||||||
Table("repository").
|
Table("repository").
|
||||||
Join("INNER", "team_repo", "`team_repo`.repo_id=`repository`.id AND `repository`.is_mirror=?", true).
|
Join("INNER", "team_repo", "`team_repo`.repo_id=`repository`.id AND `repository`.is_mirror=?", true).
|
||||||
Where(env.cond()).
|
Where(env.cond()).
|
||||||
GroupBy("`repository`.id").
|
GroupBy("`repository`.id, `repository`.updated_unix").
|
||||||
OrderBy("updated_unix DESC").
|
OrderBy("updated_unix DESC").
|
||||||
Cols("`repository`.id").
|
Cols("`repository`.id").
|
||||||
Find(&repoIDs)
|
Find(&repoIDs)
|
||||||
|
|
Reference in a new issue