Modify

Opened 14 years ago

Closed 12 years ago

#8391 closed defect (fixed)

SQL error when using PostgreSQL viewing /hours where no tickets exist

Reported by: Adam Piper Owned by: Ryan J Ollos
Priority: high Component: TracHoursPlugin
Severity: normal Keywords: postgresql postgres sql syntax error
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

While this works fine on SQLite, the WHERE ticket IN () is invalid for PostgreSQL. As such I have tweaked the code to merely return an empty list in this circumstance. See attached patch.

Attachments (1)

hours_postgres.diff (662 bytes) - added by Adam Piper 14 years ago.
patch for early return where no ticket ID is provided

Download all attachments as: .zip

Change History (6)

Changed 14 years ago by Adam Piper

Attachment: hours_postgres.diff added

patch for early return where no ticket ID is provided

comment:1 Changed 14 years ago by Ryan J Ollos

Priority: normalhigh
Status: newassigned

comment:2 Changed 14 years ago by Ryan J Ollos

#8390 closed as a duplicate.

comment:3 Changed 14 years ago by Ryan J Ollos

See also #8343 for a similar issue when running under MySQL.

comment:4 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

I'm not setup to test on PostgreSQL yet, but I'll commit the fix and please report back if it is working well for you.

comment:5 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: assignedclosed

(In [12204]) Fixes #8391: Fixed a SQL incompatibility issue on PostgreSQL. Thanks to piperad for the report and initial patch.

Modify Ticket

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