[Trac-tickets] [The Trac Project] #2773: Report fails because of
complex SQL
The Trac Project
noreply at edgewall.com
Thu Feb 16 20:35:05 CST 2006
#2773: Report fails because of complex SQL
---------------------------------+------------------------------------------
Reporter: trac-ja at i-act.co.jp | Owner: daniel
Type: defect | Status: new
Priority: normal | Milestone:
Component: report system | Version: 0.9.4
Severity: normal | Keywords:
---------------------------------+------------------------------------------
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 at 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.
--
Ticket URL: <http://projects.edgewall.com/trac/ticket/2773>
The Trac Project <http://trac.edgewall.com/>
More information about the Trac-Tickets
mailing list