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

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 22 11:17:20 UTC 2011


#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 Review
Component:  General       |     Version:  3.2.1
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by anmari):

 I just very quickly learnt a whole heap more about collation and the
 sorting and matching issues especially for foreign languages.

 I gather the _ci (case insenstive) collations are faster than the _cs
 (case sensitive) and different collations define different orders of
 search results.  Eg: _bin the binary ones do not sort the capital 'A' with
 the lower 'a'.

 It seems weird to give up accuracy for speed, and it seems that in mysql
 one can assign a collation (if available) at query time.  Is there a case
 that functions that work together should do the 'same' thing.  Eg: maybe
 use a binary collation where 'matching' keys is important?

 Are there some 'best practises' around appropriate way to handle this that
 could be communicated.  So far I've added a couple of edits to the
 get_post_meta and update_post_meta codex to highlight the risks in mixing
 case, or changing case of one's meta key.

 For others who may read, these are useful
 http://dev.mysql.com/doc/refman/5.0/en/charset-collations.html
 http://hakre.wordpress.com/2010/12/26/wordpress-database-charset-and-
 collation-configuration/

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


More information about the wp-trac mailing list