Project

General

Profile

Actions

Defect #339

closed

PostgreSQL 上ではジョエルテストが動作しない

Added by Toshiyuki Ando almost 15 years ago. Updated almost 12 years ago.

Status:
終了(Closed)
Priority:
通常(Normal)
Target version:
Start date:
04/20/2010
Due date:
04/21/2010
% Done:

100%

Estimated time:
0:15 h
Spent time:

Description

やったこと

  1. PostgreSQL でマイグレーション
  2. ジョエルテストにアクセス
  3. エラーが発生

発生したエラー

ActiveRecord::StatementInvalid (RuntimeError: ERROR C42803 Mcolumn "joel_test_scores.id" must appear in the GROUP BY clause or be used in an aggregate function F.\src\backend\parser\parse_agg.c L330 Rcheck_ungrouped_columns_walker: SELECT * FROM "joel_test_scores" GROUP BY user_id):
vendor/plugins/redmine_joel_test/app/models/joel_test_score.rb:11:in `find_last_score_by_user'
vendor/plugins/redmine_joel_test/app/controllers/joel_test_controller.rb:70:in `find_average'
vendor/plugins/redmine_joel_test/app/controllers/joel_test_controller.rb:10:in `index'

予想

from 句に使う SQL文に ORDER BY かけているのが悪いんじゃないかと思われます。

Actions #1

Updated by Takashi Takebayashi almost 15 years ago

  • Due date set to 04/21/2010
  • Status changed from 新規(New) to 終了(Closed)
  • Assignee set to Takashi Takebayashi
  • Target version set to 0.0.4
  • Start date set to 04/20/2010
  • % Done changed from 0 to 100

Toshiyuki Ando は書きました:

発生したエラー

ActiveRecord::StatementInvalid (RuntimeError: ERROR C42803 Mcolumn "joel_test_scores.id" must appear in the GROUP BY clause or be used in an aggregate function F.srcackendparserparse_agg.c L330 Rcheck_ungrouped_columns_walker: SELECT * FROM "joel_test_scores" GROUP BY user_id):
vendor/plugins/redmine_joel_test/app/models/joel_test_score.rb:11:in `find_last_score_by_user'
vendor/plugins/redmine_joel_test/app/controllers/joel_test_controller.rb:70:in `find_average'
vendor/plugins/redmine_joel_test/app/controllers/joel_test_controller.rb:10:in `index'

予想

from 句に使う SQL文に ORDER BY かけているのが悪いんじゃないかと思われます。

最新versionでは、SQL文を変更致しましたので、エラーにならない様になっているかと思います。

Actions #2

Updated by Takashi Takebayashi almost 15 years ago

Takashi Takebayashi は書きました:

最新versionでは、SQL文を変更致しましたので、エラーにならない様になっているかと思います。

最新version version 0.0.4 ではということです。

Actions #3

Updated by Takashi Takebayashi almost 15 years ago

  • Estimated time set to 0:15 h
Actions

Also available in: Atom PDF