Ticket #31869: 31869.3.diff
File 31869.3.diff, 1.5 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
1980 1980 $index_columns .= '('.$column_data['subpart'].')'; 1981 1981 } 1982 1982 } 1983 1984 // The alternative index string doesn't care about subparts 1985 $alt_index_columns = preg_replace( '/\([^)]*\)/', '', $index_columns ); 1986 $alt_index_string = $index_string; 1987 1983 1988 // Add the column list to the index create string. 1984 $index_string .= ' ('.$index_columns.')'; 1989 $index_string .= ' (' . $index_columns . ')'; 1990 $alt_index_string .= ' (' . $alt_index_columns . ')'; 1991 1985 1992 if (!(($aindex = array_search($index_string, $indices)) === false)) { 1986 1993 unset($indices[$aindex]); 1987 1994 // todo: Remove this? 1988 1995 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n"; 1989 1996 } 1997 if ( ! ( ( $aindex = array_search( $alt_index_string, $indices ) ) === false ) ) { 1998 _doing_it_wrong( __FUNCTION__, sprintf( __( 'You should be specifying an index length in the CREATE TABLE statement for the %s index.' ), "$table.$index_name" ), '4.2' ); 1999 unset( $indices[ $aindex ] ); 2000 } 1990 2001 // todo: Remove this? 1991 2002 //else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n"; 1992 2003 }