[wp-trac] [WordPress Trac] #29031: Wp Query multiple tax_query results in unexpected behavior under certain conditions

WordPress Trac noreply at wordpress.org
Sun Oct 12 15:10:35 UTC 2014


#29031: Wp Query multiple tax_query results in unexpected behavior under certain
conditions
-------------------------------+------------------------------
 Reporter:  dunar21            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Query              |     Version:  3.9.1
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------
Changes (by boonebgorges):

 * keywords:   => reporter-feedback
 * focuses:  performance =>


Comment:

 dunar21 - Thanks for the report, and sorry for the delay in getting around
 to looking at it.

 I've attempted to reproduce your issue in a unit test, but I've been
 unsuccessful. In [attachment:29031.test.patch], I've tried to match your
 query, but the tests are passing as you'd expect.

 Looking at the code that parses 'tax_query', I'm at somewhat of a loss to
 understand how the order of the 'terms' argument could matter. Your
 description of the problem suggests that the fact that the 25 actor
 doesn't have posts is causing the tax query to short circuit, but I don't
 see how this could happen - the two terms are processed together, in a SQL
 `IN` clause, not serially. See `WP_Tax_Query::transform_query()`.

 Can you share the SQL clauses that are being generated by
 `WP_Tax_Query::get_sql()`?

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


More information about the wp-trac mailing list