Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#3730 closed defect (duplicate)

Queries are not type safe for PostgreSQL 8.3

Reported by: kamil@… Owned by: coderanger
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 6 years ago by coderanger

  • Resolution set to duplicate
  • Status changed from new to closed

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

comment:2 Changed 6 years ago by anonymous

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.