[wp-trac] [WordPress Trac] #18158: Meta Query for posts with a meta key not set (IS NULL).

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 17 03:50:35 UTC 2012


#18158: Meta Query for posts with a meta key not set (IS NULL).
-------------------------------------------------+-------------------------
 Reporter:  johnnyb                              |       Owner:
     Type:  enhancement                          |  georgestephanis
 Priority:  normal                               |      Status:  accepted
Component:  Query                                |   Milestone:  Future
 Severity:  normal                               |  Release
 Keywords:  has-patch needs-unit-tests commit    |     Version:  3.2.1
  early                                          |  Resolution:
-------------------------------------------------+-------------------------

Comment (by georgestephanis):

 scribu: I think we need a if() continue; statement before it deals with
 the value part of the where clause ... EXISTS and NOT EXISTS are all
 referring exclusively to the meta_key -- if they accidentally specify a
 `$q['value']` it may add on some extra where conditionals, which I don't
 think we want.

 Also, for EXISTS, wouldn't a multi-parameter join most often be more
 efficient than a single-param join and a where clause?  Or do they break
 down to the same in the MySQL server's compiler?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18158#comment:39>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list