Modify

Opened 4 years ago

Closed 2 years ago

#8391 closed defect (fixed)

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

Reported by: piperad Owned by: rjollos
Priority: high Component: TracHoursPlugin
Severity: normal Keywords: postgresql postgres sql syntax error
Cc: Trac Release: 0.11

Description (last modified by rjollos)

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 piperad 4 years ago.
patch for early return where no ticket ID is provided

Download all attachments as: .zip

Change History (6)

Changed 4 years ago by piperad

patch for early return where no ticket ID is provided

comment:1 Changed 4 years ago by rjollos

  • Priority changed from normal to high
  • Status changed from new to assigned

comment:2 Changed 4 years ago by rjollos

#8390 closed as a duplicate.

comment:3 Changed 4 years ago by rjollos

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

comment:4 Changed 2 years ago by rjollos

  • 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 2 years ago by rjollos

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain rjollos.
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.