Merge pull request #11662 from devenbansod/fix_11661

Fix #11661 : Error changing table column's encoding (collation)
This commit is contained in:
Deven Bansod 2015-11-12 15:51:29 +05:30
commit ab5de224ad

View File

@ -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