Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3730 closed defect (duplicate)

Queries are not type safe for PostgreSQL 8.3

Reported by: Kamil Kisiel Owned by: Noah Kantrowitz
Priority: normal Component: MasterTicketsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

The MasterTicketsPlugin uses queries which don't work with PostgreSQL 8.3 due to type checking.

For example, the query on line 21 of model.py:

cursor.execute('SELECT dest FROM mastertickets WHERE source=%s ORDER BY dest', (self.tkt.id,))

returns the following error:

ERROR:  operator does not exist: text = integer
LINE 1: select dest from mastertickets where source=1 order by dest;
                                                   ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

This can be corrected by adding quotes, for example:

cursor.execute('SELECT dest FROM mastertickets WHERE source='%s' ORDER BY dest', (self.tkt.id,))

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by Noah Kantrowitz

Resolution: duplicate
Status: newclosed

There is another ticket on this. Too lazy to find it.

comment:2 Changed 9 years ago by anonymous

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
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.