Defect #5696
closed
Redmine + PostgreSQL 8.4.4 fails on _dir_list_content.rhtml
Added by Anonymous over 14 years ago.
Updated over 14 years ago.
Resolution:
Cant reproduce
Description
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
- Assignee set to Eric Davis
- Target version set to 1.0.0 (RC)
@Aurélien, I edited your report so that the code showed rather than being interpreted.
Eric Hulser, 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 Schäfer
Thank you, I wasn't aware of this formatting problem.
I grepped 'find_by_revision' in source and this comes out:
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)
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.
- Status changed from New to 7
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.
- Status changed from 7 to Closed
- Resolution set to Cant reproduce
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.
Also available in: Atom
PDF