mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed undefined variables in MySQLDatabase::indexList()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77581 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b5a0b94b96
commit
5886d4578b
@ -456,6 +456,8 @@ class MySQLDatabase extends Database {
|
||||
*/
|
||||
public function indexList($table) {
|
||||
$indexes = DB::query("SHOW INDEXES IN \"$table\"");
|
||||
$groupedIndexes = array();
|
||||
$indexList = array();
|
||||
|
||||
foreach($indexes as $index) {
|
||||
$groupedIndexes[$index['Key_name']]['fields'][$index['Seq_in_index']] = $index['Column_name'];
|
||||
@ -473,10 +475,12 @@ class MySQLDatabase extends Database {
|
||||
}
|
||||
}
|
||||
|
||||
if($groupedIndexes) {
|
||||
foreach($groupedIndexes as $index => $details) {
|
||||
ksort($details['fields']);
|
||||
$indexList[$index] = $details['type'] . '(' . implode(',',$details['fields']) . ')';
|
||||
}
|
||||
}
|
||||
|
||||
return $indexList;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user