Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#5644 closed defect (duplicate)

Incorrect (or at least nonportable) SQL in reports 6 and 7

Reported by: Dave Abrahams <dave@…> Owned by: Jonas Borgström
Priority: normal Milestone:
Component: ticket system Version: devel
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The variable $USER needs to be quoted, and at least on PostgreSQL, the "value" field of the priority enum needs to be cast to integer.

The enclosed patch fixes it but is also nonportable. It works for me, but it uses a PostgreSQL-specific cast syntax and I am too much of an SQL n00b to try with any confidence to get the portable syntax right. So please portable-ize it before you use it.

Attachments (1)

sqlfix.patch (1.3 KB ) - added by Dave Abrahams <dave@…> 17 years ago.

Download all attachments as: .zip

Change History (6)

by Dave Abrahams <dave@…>, 17 years ago

Attachment: sqlfix.patch added

comment:1 by Dave Abrahams <dave@…>, 17 years ago

Oh, also 'modified' ⇒ 'changetime'

comment:2 by Dave Abrahams <dave@…>, 17 years ago

See #5543

comment:3 by exp20070901trac@…, 17 years ago

The correct last line to the query is:

(CASE status WHEN 'closed' THEN changetime ELSE (-1)*CAST(p.value AS INT) END) DESC

I have tried to create an UPDATE query to correct the error and a correction to the db_default.py but haven't finished either.

comment:4 by exp20070901trac@…, 17 years ago

Oh, I have not trouble with $USER..

comment:5 by Christian Boos, 17 years ago

Resolution: duplicate
Status: newclosed

Let's try to fix all these issues at once, redirecting to #5543.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.