[wp-trac] [WordPress Trac] #18210: Update_post_meta is case insensitive on meta_key, but get_post_meta is NOT

WordPress Trac noreply at wordpress.org
Mon May 15 13:50:44 UTC 2017


#18210: Update_post_meta is case insensitive on meta_key, but get_post_meta is NOT
-------------------------------------------------+-------------------------
 Reporter:  anmari                               |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
Component:  Database                             |  Review
 Severity:  normal                               |     Version:  3.2
 Keywords:  dev-feedback needs-patch needs-      |  Resolution:
  unit-tests                                     |     Focuses:
                                                 |  performance
-------------------------------------------------+-------------------------

Comment (by jrchamp):

 Rather than specifying the collation, you'll have better luck using the
 BINARY keyword. Example:
 {{{#!sql
 SELECT meta_key, meta_value
 FROM wp_usermeta
 WHERE meta_key = BINARY 'Billing_last_name'
 }}}
 Not that it's also important from a performance perspective to place the
 BINARY keyword on the value side of the equals or regexp (otherwise, you
 may not be able to benefit from the existing index).

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


More information about the wp-trac mailing list