Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

#2116 closed defect (fixed)

Database error in postgres

Reported by: anonymous Owned by: Jonas Borgström
Priority: normal Milestone: 0.9
Component: general Version:
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

 Trac detected an internal error:

ERROR:  Unable to identify an operator '=' for types 'text' and 'integer'
	You will have to retype this query using an explicit cast

This is both in postgres 7.2.1 and 7.4.8 whic are on the old side, but I suspect it'll happen in newer versions too.

It's easily resolved by changing the id field in the attachment table from a test field to an integer.

Is there a good reason why the id field is text in attachment but integer in ticket and ticket_custom?

I'll be happy to provide my email when Trac provides email munging.

Attachments (0)

Change History (6)

comment:1 by anonymous, 19 years ago

Upon further investigation, it looks like the id field in the attachment can also hold a wiki page name. So the solution above does not work. Need to find something elese.

comment:2 by Christopher Lenz, 19 years ago

Probably needs a cast. Where is this error occurring, exactly?

comment:3 by Jonas Borgström, 19 years ago

Status: newassigned

comment:4 by Jonas Borgström, 19 years ago

Resolution: fixed
Status: assignedclosed

[2294] makes sure attachment ids are casted into strings before quering the database (in fetch and select).

Btw, comparing text columns with intergers seems to be possible with PostgreSQL 8.x.

comment:5 by anonymous, 19 years ago

Resolution: fixed
Status: closedreopened
Version: 0.9b1

That helped, but it needs to be fixed in one more place.

/usr/lib/python2.3/site-packages/trac/ticket/model.py

256c256
<                            (self.id, when, str(self.id), when, str(self.id), when))
---
>                            (self.id, when, self.id, when, self.id, when))
266c266
<                            "ORDER BY time", (self.id,  str(self.id), str(self.id)))
---
>                            "ORDER BY time", (self.id,  self.id, self.id))

comment:6 by Jonas Borgström, 19 years ago

Resolution: fixed
Status: reopenedclosed

Thanks, that should be fixed in [2302].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.