Edgewall Software
Modify

Opened 17 years ago

Closed 17 years ago

#4119 closed defect (fixed)

Query breaks with `id` as a field.

Reported by: Noah Kantrowitz (coderanger) <coderanger@…> Owned by: Christian Boos
Priority: normal Milestone: 0.11
Component: ticket system Version: 0.10
Severity: minor Keywords:
Cc: kantrn@…, sineer@… Branch:
Release Notes:
API Changes:
Internal Changes:

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 (0)

Change History (5)

comment:1 by sineer, 17 years ago

Cc: sineer@… added

comment:2 by sid, 17 years ago

Is this substantially different from #2604?

comment:3 by Noah Kantrowitz (coderanger) <coderanger@…>, 17 years ago

Ahh, didn't see that one when looking for an existing report. This would be the cause of that issue as well. I am not using the macro, but using a Query object directly in a plugin (the datamover plugin specifically).

comment:4 by Christian Boos, 17 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

… that's for me ;)

comment:5 by Christian Boos, 17 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r4239.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.