[wp-trac] [WordPress Trac] #43446: `meta_compare_key` should support more operators than `LIKE` and `=`

WordPress Trac noreply at wordpress.org
Wed Sep 11 15:32:53 UTC 2019


#43446: `meta_compare_key` should support more operators than `LIKE` and `=`
-------------------------------------------------+-------------------------
 Reporter:  boonebgorges                         |       Owner:
                                                 |  boonebgorges
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  5.3
Component:  Query                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch has-unit-   |     Focuses:
  tests needs-dev-note                           |
-------------------------------------------------+-------------------------

Comment (by boonebgorges):

 @soulseekah - Thanks so much for your work on this patch. I've reviewed it
 and I think it's strong. [attachment:"43446.diff"] makes a few code
 formatting and documentation changes.

 I'd like to propose that we do not include `EXISTS` and `NOT EXISTS`. The
 semantics of `EXISTS` suggests to me something less specific than `=` - as
 in the case of `key = foo && compare = EXISTS`, where you're omitting the
 `value` - but there's no corresponding "less specific" query in the case
 of keys. All rows in the meta table have a `key`. It just feels a little
 confusing to me. Perhaps others don't share my intuition - I'm happy to be
 overruled. In that case, I might make the `=` and `!=` aliases clearer in
 the documentation.

 This should be doable for 5.3, but I'll hold off a week or two in case
 someone wants to review or comment before the beta.

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


More information about the wp-trac mailing list