Ticket #4119 (closed defect: fixed)
Query breaks with `id` as a field.
| Reported by: | Noah Kantrowitz (coderanger) <coderanger@…> | Owned by: | cboos |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | ticket system | Version: | 0.10 |
| Severity: | minor | Keywords: | |
| Cc: | kantrn@…, sineer@… |
Description
The query id=5 generates the following SQL:
SELECT t.summary AS summary,t.owner AS owner,t.type AS type,t.status AS status,t.priority AS priority,t.milestone AS milestone,t.component AS component,t.time AS time,t.changetime AS changetime,t.id AS id,priority.value AS priority_value FROM ticket AS t LEFT OUTER JOIN enum AS priority ON (priority.type='priority' AND priority.name=priority) WHERE COALESCE(t.id,'')=%s ORDER BY COALESCE(t.priority,'')='',priority.value,t.id
Because of the %s, the where clause ends up looking like WHERE COALESCE(t.id,'')='5' after interpolation. This returns no rows under SQLite, probably because t.id is numeric. It works if it is WHERE COALESCE(t.id,'')=5. This did work at one point in the past (on 0.10dev).
Attachments
Change History
Note: See
TracTickets for help on using
tickets.


