[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
Tue Jan 17 21:48:46 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:  dev-feedback needs-testing has-      |     Version:  3.2.1
  patch                                          |  Resolution:
-------------------------------------------------+-------------------------

Comment (by scribu):

 Replying to [comment:16 georgestephanis]:
 > 'value' has to be included, or the meta_query gets skipped.

 That should not be the case, as you're able to specify 'meta_key' without
 'meta_value' in the main query, for example.

 > I would also recommend upgrading the db version and adding an index to
 the `meta_key` column in `wp_postmeta`


 Upgrading the db version is necessary only when modifying the schema. I
 thought the meta_key column already had an index. We should add it if it's
 not there.

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


More information about the wp-trac mailing list