diff --git a/ChangeLog b/ChangeLog index 73df4bdbf..27bb82ec2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA + [lang] Hungarian update, thanks to Jozsef Tamas Herczeg - dodika - bug #2153970 [core] Properly truncate SQL to avoid half of html tags + [lang] Romanian update, thanks to Sergiu Bivol - sbivol +- bug #2161443 [structure] Incorrect index choice shown when modifying an index 3.0.0.0 (2008-09-27) + [export] properly handle line breaks for YAML, thanks to Dan Barry - diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 8aa300bbd..8697912e9 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -47,6 +47,13 @@ class PMA_Index * @var string */ protected $_type = ''; + + /** + * The index choice (PRIMARY, UNIQUE, INDEX, FULLTEXT) + * + * @var string + */ + protected $_choice = ''; /** * Various remarks. @@ -257,6 +264,15 @@ class PMA_Index if (isset($params['Packed'])) { $this->_packed = $params['Packed']; } + if ('PRIMARY' == $this->_name) { + $this->_choice = 'PRIMARY'; + } elseif ('FULLTEXT' == $this->_type) { + $this->_choice = 'FULLTEXT'; + } elseif ('0' == $this->_non_unique) { + $this->_choice = 'UNIQUE'; + } else { + $this->_choice = 'INDEX'; + } } public function getColumnCount() @@ -291,11 +307,11 @@ class PMA_Index } /** - * Return a list of all index types + * Return a list of all index choices * - * @return array index types + * @return array index choices */ - static public function getTypes() + static public function getIndexChoices() { return array( 'PRIMARY', @@ -305,20 +321,20 @@ class PMA_Index ); } - public function getTypeSelector() + public function generateIndexSelector() { $html_options = ''; - foreach (PMA_Index::getTypes() as $each_index_type) { - if ($each_index_type === 'PRIMARY' - && $this->_name !== 'PRIMARY' + foreach (PMA_Index::getIndexChoices() as $each_index_choice) { + if ($each_index_choice === 'PRIMARY' + && $this->_choice !== 'PRIMARY' && PMA_Index::getPrimary($this->_table, $this->_schema)) { // skip PRIMARY if there is already one in the table continue; } - $html_options .= '' . "\n"; + $html_options .= '' . "\n"; } return $html_options; diff --git a/tbl_indexes.php b/tbl_indexes.php index 48435d6fa..899bd9952 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -170,7 +170,7 @@ echo (isset($_REQUEST['create_index'])