Ticket #2773 (closed defect: fixed)
Report fails because of complex SQL
| Reported by: | trac-ja@… | Owned by: | mgood |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.10.1 |
| Component: | report system | Version: | 0.9.4 |
| Severity: | normal | Keywords: | |
| Cc: | trac@…, rhind@…, vortechs2000@… |
Description
When Report has complex SQL like:
SELECT (CASE owner WHEN '$USER' THEN '1:My own tickets'
ELSE CASE reporter WHEN '$USER' THEN '2:Tickets reported by me'
ELSE '3:Tickets join as CC' END END) AS __group__,
value AS __color__,
id AS ticket,
summary,
type AS _type,
component AS _component,
milestone,
status,
resolution,
version AS _version,
priority AS _priority,
severity AS _severity,
time AS _created,
changetime AS modified,
reporter AS _reporter,
owner,
cc AS _cc,
description AS _description
FROM ticket t,
(SELECT name, value FROM enum WHERE type = 'priority') p
WHERE t.priority = p.name AND
(reporter = '$USER' OR owner = '$USER' OR cc like '%$USER%') AND
NOT EXISTS(SELECT *
FROM ticket_custom
WHERE name = 'completed' AND
value = '1' AND
ticket = id)
ORDER BY __group__, __color__, id
fails with that message:
Report execution failed: unsupported format character ''' (0x27) at index 769
Perhaps, This error occurs at source:/tags/trac-0.9.4/trac/db.py@2575#L217 that replacing %s to ?.
Additionally, It doesn't occur in trac-0.9.3, but db.py is no diffs between trac-0.9.3 to trac-0.9.4.


