Opened 19 years ago
Closed 19 years ago
#2709 closed defect (bug) (fixed)
Category query cleanups
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.1 | Priority: | high |
Severity: | major | Version: | 2.0.2 |
Component: | Administration | Keywords: | category query |
Focuses: | Cc: |
Description
Category queries concatenate category_id conditions.
How about doing it this way:
?cat=1,2,3,-4,-5,6,-8,-9 AND category_id IN (1, 2, 3, 6) AND category_id NOT IN (4, 5, 8, 9)
We also need to put UNIQUE back in due to the way JOIN returns one row for every matching post2cat record.
Attachments (1)
Change History (5)
#2
@
19 years ago
Due to the JOIN, NOT IN can fail in this circumstance: a post is in two categories, one of which is not in the NOT IN list. The usual case here is that a post is in categores "Parent" and "Child", and the excluded category is "Child." In this case, the post will appear because the JOIN returns a row with the the category_id of Parent, which is not an excluded category.
I think this is acceptable. Any argument?
Note: See
TracTickets for help on using
tickets.
Um, DISTINCT.