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