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: | 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)
Change History (6)
by , 17 years ago
Attachment: | sqlfix.patch added |
---|
comment:1 by , 17 years ago
comment:3 by , 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:5 by , 17 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Let's try to fix all these issues at once, redirecting to #5543.
Oh, also 'modified' ⇒ 'changetime'