[wp-trac] [WordPress Trac] #10994: 2.8.5 Multiple primary key Error

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 19 20:06:30 UTC 2009


#10994: 2.8.5 Multiple primary key Error
-----------------------------+----------------------------------------------
 Reporter:  Frumph           |       Owner:       
     Type:  defect (bug)     |      Status:  new  
 Priority:  high             |   Milestone:  2.9  
Component:  Upgrade/Install  |     Version:  2.8.4
 Severity:  critical         |    Keywords:       
-----------------------------+----------------------------------------------

Comment(by miqrogroove):

 At first glance, function dbDelta() appears to issue the ALTER command as
 follows:

 {{{
 if(!(($aindex = array_search($index_string, $indices)) === false)) {
     unset($indices[$aindex]);
 }
 // For every remaining index specified for the table
 foreach ( (array) $indices as $index ) {
     // Push a query line into $cqueries that adds the index to that table
     $cqueries[] = "ALTER TABLE {$table} ADD $index";
 }
 }}}

 That logic is extremely deficient if it is being used in production to
 modify table indices.

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


More information about the wp-trac mailing list