Edgewall Software
Modify

Opened 13 years ago

Last modified 13 years ago

#10525 new defect

TicketQuery macro broken for some keywords-based queries

Reported by: Itamar Oren Owned by:
Priority: normal Milestone: next-major-releases
Component: query system Version: 0.13dev
Severity: major Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Example:

  1. What I want- A list of tickets that contain the keyword svnauthz and also does not contain the keyword permission
  2. How I think I should do it- [[TicketQuery(keywords~=svnauthz&keywords!~=permission, format=table, col=keywords)]]
  3. The result:

Ticket Keywords
#4231 svnauthz, consider, authzsourcepolicy
#4503 permission, svnauthz, unicode, authzsourcepolicy
#4997 svnauthz, swig, consider, authzsourcepolicy
#5097 svnauthz, authzsourcepolicy
#5246 patch svnauthz authzsourcepolicy
#5640 svnauthz, multirepos, authzsourcepolicy
#6007 browser, security, changeset, svnauthz, authzsourcepolicy
#6143 svnauthz, needinfo, authzsourcepolicy
#7116 permissions, authzpolicy, svnauthz, multirepos, authzsourcepolicy
#7343 svnauthz, authzsourcepolicy
#8269 svnauthz, documentation, authzsourcepolicy
#8289 svnauthz, authzsourcepolicy
#8336 download, svnauthz, verify, authzsourcepolicy
#9215 svnauthz, unicode, authzsourcepolicy
#9976 svnauthz, authzsourcepolicy
#10727 svnauthz, authzsourcepolicy
#11026 svnauthz, needinfo, authzsourcepolicy
#11744 svnauthz authzsourcepolicy
#12637 svnauthz authzsourcepolicy

The problem

Note that #4503 is on the list, although it has the permission keyword.

In fact, the result is identical to [[TicketQuery(keywords~=svnauthz, format=table, col=keywords)]].

I have observed the same issue in 0.12.3dev, and was able to debug this into the trac.ticket.query.Query class.

When executing the query, the keywords constraint looks like {'keywords': ['~svnauthz', '!~permission']}, but in get_clause_sql the neg and mode variables are set only according to the first item (e.g. '~svnauthz'), so the generated SQL comes out messed up w.r.t the second constraint.

Sorry for not suggesting a patch, but this code is quite complex…

Attachments (0)

Change History (1)

comment:1 by Christian Boos, 13 years ago

Component: ticket systemquery system
Milestone: next-major-0.1X

No patch, no milestone ;-)

But you're right, this would be very useful if fixed.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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