Fix which index object is used when dropping indices with PHP API
authorMatthias Schmidt <gravatronics@live.com>
Fri, 29 Jan 2021 15:22:50 +0000 (16:22 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 29 Jan 2021 15:22:50 +0000 (16:22 +0100)
Only `$matchingExistingIndex` is guaranteed to have the correct index name.

wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php

index e595d3de39c31dec8f7c5a6c9b04701c734b08d2..87fc5051e438ac2f29cbda716c656f3746517aad 100644 (file)
@@ -487,7 +487,7 @@ class DatabaseTableChangeProcessor {
                                                        if (!isset($this->indicesToDrop[$tableName])) {
                                                                $this->indicesToDrop[$tableName] = [];
                                                        }
-                                                       $this->indicesToDrop[$tableName][] = $index;
+                                                       $this->indicesToDrop[$tableName][] = $matchingExistingIndex;
                                                        
                                                        $this->splitNodeMessage .= "Dropped index '{$tableName}." . implode(',', $index->getColumns()) . "'.";
                                                        break 2;