プロジェクト

全般

プロフィール

Vote #67431

完了

Redmine + PostgreSQL 8.4.4 fails on _dir_list_content.rhtml

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Database_21
対象バージョン:
開始日:
2010/06/16
期日:
進捗率:

0%

予定工数:
category_id:
21
version_id:
14
issue_org_id:
5696
author_id:
16698
assigned_to_id:
5
comments:
8
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
17
ステータス-->[Closed]

説明

This bug is very similar to #3942.

When requesting directory contents, postgresql fails with an error like:

PGError: ERROR: operator does not exist: character varying = integer

The solution is about the same.
I changed in _dir_list_content.rhtml
@< % changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier % >@
to
@< % changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier.to_s) if entry.lastrev && entry.lastrev.identifier % >@
and it worked.

About:

  • Ubuntu server 10.04
  • Redmine 0.9.3
  • PostgreSQL 8.4.4
  • Ruby version 1.8.7 (i486-linux)
  • RubyGems version 1.3.5
  • Rails version 2.2.3
  • Active Record version 2.2.3
  • Action Pack version 2.2.3
  • Active Resource version 2.2.3
  • Action Mailer version 2.2.3
  • Active Support version 2.2.3
  • Edge Rails revision unknown
  • Application root /usr/share/redmine
  • Environment production
  • Database adapter postgresql
  • Database schema version 20100221100219

journals

@Aurélien, I edited your report so that the code showed rather than being interpreted.

@Eric, this fix seems simple enough, though I'm not sure why the postgres adapter needs an explicitely cast string. The other thing bothering me is it seems wikified text doesn't get sanitized correctly, stuff in "< % % >" seems to either get thrown out or (worse) rendered.
--------------------------------------------------------------------------------
@Felix
Thank you, I wasn't aware of this formatting problem.

I grepped 'find_by_revision' in source and this comes out:

<pre>
app/views/repositories/_dir_list_content.rhtml:19:<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier.to_s) if entry.lastrev && entry.lastrev.identifier %>
app/helpers/application_helper.rb:513: if project && (changeset = project.changesets.find_by_revision(identifier))
app/models/repository/darcs.rb:32: patch = identifier.nil? ? nil : changesets.find_by_revision(identifier)
app/models/repository/darcs.rb:37: patch = identifier.nil? ? nil : changesets.find_by_revision(identifier)
app/models/repository/darcs.rb:55: patch = identifier.nil? ? nil : changesets.find_by_revision(identifier.to_s)
app/models/repository/darcs.rb:60: patch_from = changesets.find_by_revision(rev)
app/models/repository/darcs.rb:62: patch_to = changesets.find_by_revision(rev_to) if rev_to
app/models/repository/cvs.rb:33: rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
app/models/repository/cvs.rb:38: rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
app/models/repository/cvs.rb:43: change=changes.find_by_revision_and_path( entry.lastrev.revision, scm.with_leading_slash(entry.path) )
app/models/repository/cvs.rb:57: rev = identifier.nil? ? nil : changesets.find_by_revision(identifier)
app/models/repository/cvs.rb:64: changeset_from=changesets.find_by_revision(rev)
app/models/repository/cvs.rb:66: changeset_to=changesets.find_by_revision(rev_to)
</pre>

Maybe those also need to be escaped for postgresql ? I'm sure since I do not use darcs neither cvs, I can't say if it is a problem or not.
--------------------------------------------------------------------------------
Seems like Postgres 8.3 and 8.4 differ in the way the interpret data types. Especially by interpreting strings as integers and vice versa. We have seen various such issues in the last few days.
--------------------------------------------------------------------------------
Anyone have access to a Postgres 8.3 database to test this out on? I'm on 8.4 and don't want to fight a downgrade if I can help it.
--------------------------------------------------------------------------------
I can, I'll give you a feedback in the day.
--------------------------------------------------------------------------------
I did not have the time to test it deeply, but it seems it works fine with Postgresql 8.3. Maybe I'll have a bit more time tomorrow evening (french hours, it's 19h30 here!) to explore it if you want.
--------------------------------------------------------------------------------
Postgres 8.3 works as advertised with and without the original patch.
--------------------------------------------------------------------------------
I'm closing this as can't reproduce.

Aurélien Pocheville, once Redmine 1.0 is released could you upgrade and let us know if this is still happening for you? If so, feel free to reopen the issue.
--------------------------------------------------------------------------------


related_issues

relates,Closed,3942,Redmine + PostgreSQL 8.3: ActiveRecord::StatementInvalid in RepositoriesController#revision

Admin Redmine さんが3年以上前に更新

  • カテゴリDatabase_21 にセット
  • 対象バージョン1.0.0 (RC)_14 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0