diff --git a/libraries/controllers/TableStructureController.class.php b/libraries/controllers/TableStructureController.class.php index 48853af17c..1f1b0f80dc 100644 --- a/libraries/controllers/TableStructureController.class.php +++ b/libraries/controllers/TableStructureController.class.php @@ -696,6 +696,13 @@ class TableStructureController extends TableController PMA_previewSQL(count($changes) > 0 ? $sql_query : ''); } + $columns_with_index = $this->dbi + ->getTable($this->db, $this->table) + ->getColumnsWithIndex( + PMA_Index::PRIMARY | PMA_Index::UNIQUE | PMA_Index::INDEX + | PMA_Index::SPATIAL | PMA_Index::FULLTEXT + ); + $changedToBlob = array(); // While changing the Column Collation // First change to BLOB @@ -703,6 +710,7 @@ class TableStructureController extends TableController if (isset($_REQUEST['field_collation'][$i]) && isset($_REQUEST['field_collation_orig'][$i]) && $_REQUEST['field_collation'][$i] !== $_REQUEST['field_collation_orig'][$i] + && ! in_array($_REQUEST['field_orig'][$i], $columns_with_index) ) { $secondary_query = 'ALTER TABLE ' . PMA_Util::backquote( $this->table