Modify ↓
#6776 closed defect (fixed)
text = integer in view ticket on PostgreSQL 8.3 final
| Reported by: | Owned by: | John Hampton | |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | ticket system | Version: | devel |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
Traceback (most recent call last):
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\api.py", line 339, in send_error
'text/html')
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\chrome.py", line 670, in render_template
if not req.session or not int(req.session.get('accesskeys', 0)):
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\api.py", line 168, in __getattr__
value = self.callbacks[name](self)
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\main.py", line 255, in _get_session
return Session(self.env, req)
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\session.py", line 53, in __init__
self.get_session(req.authname, authenticated=True)
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\web\session.py", line 74, in get_session
(sid, int(authenticated)))
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "c:\work\python25\lib\site-packages\Trac-0.11b1-py2.5.egg\trac\db\util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: current transaction is aborted, commands ignored until end of transaction block
From log:
2008-02-06 12:54:30,703 Trac[main] ERROR: operator does not exist: text = integer
LINE 1: ...mment',null,description,0 FROM attachment WHERE id=17 ORDER ...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Traceback (most recent call last):
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\web\main.py", line 406, in _dispatch_request
dispatcher.dispatch(req)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\web\main.py", line 195, in dispatch
resp = chosen_handler.process_request(req)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\web_ui.py", line 159, in process_request
return self._process_ticket_request(req)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\web_ui.py", line 482, in _process_ticket_request
get_reporter_id(req, 'author'), field_changes)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\web_ui.py", line 1104, in _insert_ticket_data
for change in self.rendered_changelog_entries(req, ticket):
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\web_ui.py", line 1202, in rendered_changelog_entries
for group in self.grouped_changelog_entries(ticket, None, when):
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\web_ui.py", line 1269, in grouped_changelog_entries
changelog = ticket.get_changelog(when=when, db=db)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\ticket\model.py", line 310, in get_changelog
"ORDER BY time", (self.id, str(self.id), self.id))
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\db\util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
File "c:\work\python25\lib\site-packages\Trac-0.11dev_r6486-py2.5.egg\trac\db\util.py", line 50, in execute
return self.cursor.execute(sql_escape_percent(sql), args)
ProgrammingError: operator does not exist: text = integer
LINE 1: ...mment',null,description,0 FROM attachment WHERE id=17 ORDER ...
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
I think, it is same error as #6274
Attachments (1)
Change History (6)
comment:1 by , 18 years ago
comment:2 by , 18 years ago
attached is the patch.
-
model.py
297 297 "SELECT time,author,'comment',null,description,0 " 298 298 "FROM attachment WHERE id=%s AND time=%s " 299 299 "ORDER BY time", 300 (self.id, when_ts, str(self.id), when_ts, s elf.id, when_ts))300 (self.id, when_ts, str(self.id), when_ts, str(self.id), when_ts)) 301 301 else: 302 302 cursor.execute("SELECT time,author,field,oldvalue,newvalue,1 " 303 303 "FROM ticket_change WHERE ticket=%s " … … 307 307 "UNION " 308 308 "SELECT time,author,'comment',null,description,0 " 309 309 "FROM attachment WHERE id=%s " 310 "ORDER BY time", (self.id, str(self.id), s elf.id))310 "ORDER BY time", (self.id, str(self.id), str(self.id))) 311 311 log = [] 312 312 for t, author, field, oldvalue, newvalue, permanent in cursor: 313 313 log.append((datetime.fromtimestamp(int(t), utc), author, field,
comment:4 by , 18 years ago
| Keywords: | fixowner added |
|---|
Thanks for taking care of this one, but please don't forget to assign the ticket to yourself next time!
comment:5 by , 17 years ago
| Keywords: | fixowner removed |
|---|---|
| Owner: | changed from to |
Note:
See TracTickets
for help on using tickets.



Fixed by add str() → file ticket/model.py (from line 290):
if when_ts: cursor.execute("SELECT time,author,field,oldvalue,newvalue,1 " "FROM ticket_change WHERE ticket=%s AND time=%s " "UNION " "SELECT time,author,'attachment',null,filename,0 " "FROM attachment WHERE id=%s AND time=%s " "UNION " "SELECT time,author,'comment',null,description,0 " "FROM attachment WHERE id=%s AND time=%s " "ORDER BY time", (self.id, when_ts, str(self.id), when_ts, str(self.id), when_ts)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue,1 " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time,author,'attachment',null,filename,0 " "FROM attachment WHERE id=%s " "UNION " "SELECT time,author,'comment',null,description,0 " "FROM attachment WHERE id=%s " "ORDER BY time", (self.id, str(self.id), str(self.id)))