Ticket #31869: 31869.diff
File 31869.diff, 2.0 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
1963 1963 if ($index_name != 'PRIMARY') { 1964 1964 $index_string .= $index_name; 1965 1965 } 1966 $ index_columns = '';1966 $alt_index_columns = $index_columns = ''; 1967 1967 1968 1968 // For each column in the index. 1969 1969 foreach ($index_data['columns'] as $column_data) { 1970 if ($index_columns != '') $index_columns .= ','; 1970 if ( '' != $index_columns ) { 1971 $index_columns .= ','; 1972 $alt_index_columns .= ','; 1973 } 1971 1974 1972 1975 // Add the field to the column list string. 1973 $index_columns .= $column_data['fieldname']; 1976 $index_columns .= $column_data['fieldname']; 1977 $alt_index_columns .= $column_data['fieldname']; 1974 1978 if ($column_data['subpart'] != '') { 1979 // We don't add the subpart to the alternative index string 1975 1980 $index_columns .= '('.$column_data['subpart'].')'; 1976 1981 } 1977 1982 } 1983 1984 $alt_index_string = $index_string; 1985 1978 1986 // Add the column list to the index create string. 1979 $index_string .= ' ('.$index_columns.')'; 1987 $index_string .= ' (' . $index_columns . ')'; 1988 $alt_index_string .= ' (' . $alt_index_columns . ')'; 1980 1989 if (!(($aindex = array_search($index_string, $indices)) === false)) { 1981 1990 unset($indices[$aindex]); 1982 1991 // todo: Remove this? 1983 1992 //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n"; 1984 1993 } 1994 if ( ! ( ( $aindex = array_search( $alt_index_string, $indices ) ) === false ) ) { 1995 _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' ); 1996 unset( $indices[ $aindex ] ); 1997 } 1985 1998 // todo: Remove this? 1986 1999 //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 2000 }