From f62c045dd3366ebc4e3932fe31aa4fb6fc85544e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 17 Aug 2019 13:33:56 +0200 Subject: [PATCH] Only return each index once in MysqlDatabaseEditor::getIndices() Close #3012 --- .../files/lib/system/database/editor/DatabaseEditor.class.php | 2 +- .../lib/system/database/editor/MySQLDatabaseEditor.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php index 3592bd0e97..393c984a17 100644 --- a/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php @@ -42,7 +42,7 @@ abstract class DatabaseEditor { abstract public function getColumns($tableName); /** - * Returns the indices of a table. + * Returns the names of indices of a table. * * @param string $tableName * @return array $indices diff --git a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php index 5779a23b5b..91e92076ea 100644 --- a/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php +++ b/wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php @@ -103,7 +103,7 @@ class MySQLDatabaseEditor extends DatabaseEditor { $indices[] = $row['Key_name']; } - return $indices; + return array_unique($indices); } /** -- 2.20.1