[wp-trac] [WordPress Trac] #30681: Using a value in a meta_query (in WP_Query) combined with EXISTS OR NOT EXISTS breaks query

WordPress Trac noreply at wordpress.org
Thu Dec 11 22:05:10 UTC 2014


#30681: Using a value in a meta_query (in WP_Query) combined with EXISTS OR NOT
EXISTS breaks query
----------------------------------------+--------------------
 Reporter:  barrykooij                  |       Owner:
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  4.1
Component:  Query                       |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+--------------------
Changes (by johnbillion):

 * keywords:   => has-patch needs-unit-tests
 * component:  General => Query
 * milestone:  Awaiting Review => 4.1


Comment:

 To clarify, the current code results in an invalid WHERE clause that looks
 like this (note the empty brackets):

 `CAST(wp_postmeta.meta_value AS CHAR) NOT EXISTS '' )`

 We'll need some unit tests here to cover this.

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


More information about the wp-trac mailing list