[wp-trac] [WordPress Trac] #10905: Do not allow duplicate (post_id, meta_key, meta_value) rows in meta tables

WordPress Trac wp-trac at lists.automattic.com
Sat Dec 26 23:50:08 UTC 2009


#10905: Do not allow duplicate (post_id, meta_key, meta_value) rows in meta tables
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:  ryan          
     Type:  defect (bug)  |      Status:  new           
 Priority:  normal        |   Milestone:  Future Release
Component:  Database      |     Version:  2.9           
 Severity:  normal        |    Keywords:  needs-patch   
--------------------------+-------------------------------------------------

Comment(by hakre):

 Replying to [comment:1 scribu]:
 > When trying to add a UNIQUE index to post_id, meta_key and meta_value I
 get an error:
 >
 > {{{
 > #1170 - BLOB/TEXT column 'meta_value' used in key specification without
 a key length
 > }}}
 >
 Can you please provide the SQL you used to create the key? That would be
 interesting.

 > So this will have to be resolved through the *_metadata() API.
 Let's see. It might work with SQL, maybe you have just forgotten to use
 some more parameters / options in the SQL Statement.

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


More information about the wp-trac mailing list