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

Comments

Projects
None yet
4 participants
@n-rodriguez
Member

n-rodriguez commented Dec 29, 2014

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

@n-rodriguez n-rodriguez added the bug label Dec 29, 2014

@dgeo

This comment has been minimized.

Show comment
Hide comment
@dgeo

dgeo 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 :)

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

@RomanSyroeshko

This comment has been minimized.

Show comment
Hide comment
@RomanSyroeshko

RomanSyroeshko 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.

RomanSyroeshko 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

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Feb 23, 2015

Member

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

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

Member

n-rodriguez commented Feb 23, 2015

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

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

@niosHD

This comment has been minimized.

Show comment
Hide comment
@niosHD

niosHD 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.

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

This comment has been minimized.

Show comment
Hide comment
@n-rodriguez

n-rodriguez Mar 15, 2015

Member

@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 :)

Member

n-rodriguez commented Mar 15, 2015

@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 from Error in statistics view to PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause Mar 16, 2015

@n-rodriguez n-rodriguez changed the title from PG::GroupingError: ERROR: column "changesets.id" must appear in the GROUP BY clause to [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