Modify

Opened 13 years ago

Closed 13 years ago

#9971 closed defect (fixed)

PostgreSQL 9.1: ProgrammingError: column "ticket_type" does not exist

Reported by: msudyin@… Owned by: anonymous
Priority: normal Component: ChildTicketsPlugin
Severity: blocker Keywords:
Cc: Trac Release: 0.12

Description

Hello,

On Trac 0.12.3 with PostgewSQL 9.1 database back-end the following error is observed when try to go Admin > Child Tickets Plugin > Parent Types page:

2012-04-17 22:11:05,817 Trac[main] ERROR: Internal Server Error:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 522, in _dispatch_request
    dispatcher.dispatch(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/admin/web_ui.py", line 117, in process_request
    path_info)
  File "/usr/local/lib/python2.6/dist-packages/Tracchildtickets-2.5.0-py2.6.egg/childtickets/admin.py", line 43, in render_admin_panel
    for t in self._types():
  File "/usr/local/lib/python2.6/dist-packages/Tracchildtickets-2.5.0-py2.6.egg/childtickets/admin.py", line 133, in _types
    cursor.execute('select name from enum where type="ticket_type"')
  File "/usr/local/lib/python2.6/dist-packages/Trac-0.12.3-py2.6.egg/trac/db/util.py", line 66, in execute
    return self.cursor.execute(sql)
ProgrammingError: column "ticket_type" does not exist
LINE 1: select name from enum where type="ticket_type"
                                         ^
ProgrammingError: column "ticket_type" does not exist
LINE 1: select name from enum where type="ticket_type"
                                         ^

Issue is fixed easily:

--- childtickets/admin.py.orig       2012-04-15 19:48:06.000000000 +0700
+++ childtickets/admin.py            2012-04-17 22:20:32.000000000 +0700
@@ -130,7 +130,7 @@ class ChildTicketsAdminPanel(Component):
         # For trac 0.13 : self.env.db_query('SELECT name FROM enum WHERE type="ticket_type"')
         db = self.env.get_db_cnx()
         cursor = db.cursor()
-        cursor.execute('select name from enum where type="ticket_type"')
+        cursor.execute("select name from enum where type='ticket_type'")
         if not ptype:
             # No parent type supplied, return simple list.
             return [ x for (x,) in cursor.fetchall() ]

Attachments (0)

Change History (3)

comment:1 Changed 13 years ago by anonymous

same problem, I created same patch and now it works fine.

comment:2 Changed 13 years ago by anonymous

Owner: changed from Mark Ryan to anonymous
Status: newassigned

comment:3 Changed 13 years ago by Mark Ryan

Resolution: fixed
Status: assignedclosed

(In [11509]) Release 2.5.1

  • Fixes #9971
  • Applied patch as supplied in ticket
  • Thanks guys - great to get such an easy fix

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anonymous.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.