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

[Statistics view] PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause #322

Closed
n-rodriguez opened this issue Dec 29, 2014 · 5 comments
Assignees
Labels
Milestone

Comments

@n-rodriguez
Copy link
Contributor

ActionView::Template::Error (PG::GroupingError: ERROR:  column "changesets.id" must appear in 
the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT "changesets".* FROM "changesets"  WHERE "changesets"....
               ^
: SELECT "changesets".* FROM "changesets"  WHERE "changesets"."repository_id" = 1 AND (user_id IS NOT NULL) GROUP BY committer):

...
...
plugins/redmine_git_hosting/lib/redmine_git_hosting/patches/repository_patch.rb:170:in `commits_per_author_with_aliases'
@n-rodriguez n-rodriguez self-assigned this Dec 29, 2014
@dgeo
Copy link

dgeo commented Jan 7, 2015

Same bug here...

If it can help, this sql query works:
SELECT "changesets".committer,count(id) FROM "changesets" WHERE "changesets"."repository_id" = 1 AND (user_id IS NOT NULL) GROUP BY committer

I may try patches here too :)

@n-rodriguez n-rodriguez added this to the v1.1.0 milestone Jan 26, 2015
@ghost
Copy link

ghost commented Feb 13, 2015

Hello @n-rodriguez,

We experience the same problem after migration from 0.6.2 onto 0.7.10.

Any chance to get it fixed in 0.7.x branch?

Thanks.

@n-rodriguez
Copy link
Contributor Author

Any chance to get it fixed in 0.7.x branch?

Nope. I won't do other fixes on the 0.7 branch.

@niosHD
Copy link

niosHD commented Mar 14, 2015

I just upgraded to the recent development version of the plugin and redmine 3.0.0 and want to report another SQL problem which is related to the statistic functionality. It is definitely not the same bug like above which seems to be a postgres vs mysql incompatibility. However, maybe they could be fixed in one go.

The Query from repository_commits_stats.rb#L133 crashes with the following error:

Mysql2::Error: Unknown column 'changes.commit_date' in 'order clause': SELECT COUNT(*) AS count_all, commit_date AS commit_date FROM `changes` INNER JOIN `changesets` ON `changesets`.`id` = `changes`.`changeset_id` WHERE (changesets.repository_id = 11) GROUP BY commit_date  ORDER BY `changes`.`commit_date` ASC

I suspect that it is a result of the active record update which came with the new redmine.

@n-rodriguez
Copy link
Contributor Author

@niosHD

It is definitely not the same bug like above which seems to be a postgres vs mysql incompatibility.

Thanks for your feedback but can you please open a new issue, I'm gonna close this one :)

@n-rodriguez n-rodriguez modified the milestones: v1.0.3, v1.1.0 Mar 15, 2015
@n-rodriguez n-rodriguez changed the title Error in statistics view PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause Mar 16, 2015
@n-rodriguez n-rodriguez changed the title PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause [Statistics view] PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause Mar 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants