[wp-trac] [WordPress Trac] #41796: WP_Term_Query problem using object_ids and number attributes

WordPress Trac noreply at wordpress.org
Wed Sep 13 14:47:09 UTC 2017


#41796: WP_Term_Query problem using object_ids and number attributes
-------------------------------------+---------------------------
 Reporter:  elvishp2006              |       Owner:  boonebgorges
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  4.9
Component:  Taxonomy                 |     Version:  4.8.1
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"41377"]:
 {{{
 #!CommitTicketReference repository="" revision="41377"
 Taxonomy: Force a `DISTINCT` term query when result count matters.

 Generally, duplicate terms returned by a term query are eliminated in PHP,
 after the database query takes place. This technique doesn't work properly
 when the query parameters specify the `number` of results, since the
 results
 of a `SELECT ... LIMIT x...` query may be deduplicated to a count less
 than
 `x`. In these cases, we force the original query to be `DISTINCT`.

 Props elvishp2006.
 Fixes #41796.
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41796#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list