Only return each index once in MysqlDatabaseEditor::getIndices()
authorMatthias Schmidt <gravatronics@live.com>
Sat, 17 Aug 2019 11:33:56 +0000 (13:33 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 17 Aug 2019 11:33:56 +0000 (13:33 +0200)
Close  #3012

wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php

index 3592bd0e9770da90444c109b759eca9dbec51f44..393c984a17f37ef8964a90f33d4ed5b08e974fc4 100644 (file)
@@ -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
index 5779a23b5bfa57c76815bb09fc76a936d681cba0..91e92076ea1d45178b01e7bc3fd69209f03ad1c1 100644 (file)
@@ -103,7 +103,7 @@ class MySQLDatabaseEditor extends DatabaseEditor {
                        $indices[] = $row['Key_name'];
                }
                
-               return $indices;
+               return array_unique($indices);
        }
        
        /**