Ticket #5543 (closed defect: fixed)
Opened 5 years ago
Last modified 4 years ago
Default reports ({6}, {7}, {11} maybe others) are not working for all backends
| Reported by: | Dave Abrahams <dave@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | high | Milestone: | 0.11 |
| Component: | report system | Version: | devel |
| Severity: | major | Keywords: | postgresql |
| Cc: | trac-ja@… | ||
| Release Notes: | |||
| API Changes: | |||
Description
at least under postgresql... there's a syntax error in the last line:
(CASE status WHEN 'closed' THEN modified ELSE (-1)*p.value END) DESC
psql flags "modified" as a syntax error.
Attachments
Change History
comment:1 Changed 5 years ago by Dave Abrahams <dave@…>
- Component changed from general to report system
- Owner changed from jonas to mgood
- Severity changed from normal to critical
comment:2 Changed 4 years ago by cboos
- Keywords sql added
- Milestone set to 0.11.1
- Severity changed from critical to major
- Summary changed from Query {6} is broken to Default reports ({6}, {7}, {11} maybe others) are not working for all backends
comment:3 Changed 4 years ago by cboos
#5840 was closed as duplicate.
comment:4 Changed 4 years ago by cboos
comment:5 Changed 4 years ago by cboos
- Keywords postgresql added; sql removed
- Priority changed from normal to high
Another duplicate, #6846.
comment:6 Changed 4 years ago by trac-ja@…
- Cc trac-ja@… added
comment:7 Changed 4 years ago by trac-ja@…
I encount this bug at {6} with native stacktrace.
({7} runs normally.)
There are two problems:
- SQL compatibility
- When catch Exception from DB, Must show TracError page
This patch fixes problem 1 againsts source:trunk@6653.
It is tested on SQLite-3.4.3 (on Ubuntu-7.10)
and PostgreSQL-8.2.6(on Ubuntu-7.10), however
it is not tested on MySQL.
-
trac/db_default.py
280 280 FROM ticket t 281 281 LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' 282 282 ORDER BY (milestone IS NULL), milestone DESC, (status = 'closed'), 283 (CASE status WHEN 'closed' THEN modified ELSE (-1)*p.valueEND) DESC284 """ ),283 (CASE status WHEN 'closed' THEN changetime ELSE (-1) * %s END) DESC 284 """ % db.cast('p.value', 'int')), 285 285 #---------------------------------------------------------------------------- 286 286 ('My Tickets', 287 287 """
comment:8 Changed 4 years ago by cboos
- Milestone changed from 0.11.1 to 0.11
- Owner changed from mgood to cboos
- Status changed from new to assigned
Thanks for the patch! I'll (reluctantly) check for MySQL.
I think it's worth getting applied for 0.11, as we can anticipate a lot of fresh installs when 0.11 ships and ... a lot of new duplicates of this ticket if it is not fixed before.
comment:9 Changed 4 years ago by cboos
- Resolution set to fixed
- Status changed from assigned to closed
Verified for MySQL and committed as [6674].



Several fixes are required in this report: