Modify

Opened 16 years ago

Closed 16 years ago

#2315 closed defect (wontfix)

blocked_by returns too many tickets

Reported by: anonymous Owned by: Noah Kantrowitz
Priority: high Component: MasterTicketsPlugin
Severity: critical Keywords:
Cc: Trac Release: 0.10

Description

I have ticket 7,17 and 18. 18 blocks 17. If I call blocked_by in util.py passing 7 as ticket id, I receive the info that 18 blocks 7.

This is related to the SQL query SELECT ticket FROM ticket_custom

WHERE name='blocking' AND (value LIKE '%7,%' OR value LIKE '%7')

That should probably be replaced by

SELECT ticket FROM ticket_custom

WHERE name='blocking' AND (value='7' OR value LIKE '%,7,%' OR value LIKE '7,%' OR value LIKE '%,7')

Leading to the following python code

cursor.execute('SELECT ticket FROM ticket_custom WHERE name=%s AND (value=%s OR value LIKE %s OR value LIKE %s OR value LIKE %s)',

('blocking', '%s'%tkt, '%s,%%'%tkt, '%%,%s,%%'%tkt, '%%,%s'%tkt))

This change fixed the problem here. Don't know if there is any side effect

Regards Philippe

Attachments (0)

Change History (1)

comment:1 Changed 16 years ago by Noah Kantrowitz

Resolution: wontfix
Status: newclosed

The 0.10 version is entirely unmaintained. Please use the 0.11 version.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Noah Kantrowitz.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.