﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
21272	reporting typo in dbDelta	apimlott		"In dbDelta, there is the section:


{{{
                // 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"";
                        $for_update[$table.'.'.$fieldname] = 'Added index '.$table.' '.$index;
                }
}}}

Note that $for_update is updated with the wrong array index.  This causes some updates not to be returned in $for_update.  Better would be:

{{{
                        $for_update[$table.'.'.$index] = 'Added index '.$table.' '.$index;
}}}

Even this is not really right, since indexes and columns may have the same names.  Given that the users of dbDelta don't even seem to care about the keys, it might be simpler just to change all the $for_update lines to

{{{
                        $for_update[] = ...
}}}

except for the first one that must be keyed on table name."	defect (bug)	new	normal	3.6	Database	3.4.1	minor		has-patch	
