Opened 14 years ago
Last modified 14 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:
- What I want- A list of tickets that contain the keyword
svnauthzand also does not contain the keywordpermission - How I think I should do it-
[[TicketQuery(keywords~=svnauthz&keywords!~=permission, format=table, col=keywords)]] - 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 , 14 years ago
| Component: | ticket system → query system |
|---|---|
| Milestone: | → next-major-0.1X |



No patch, no milestone ;-)
But you're right, this would be very useful if fixed.