From 89e422c1fdf2db0626e1edc7911b4285117d55ad Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Fri, 17 Jun 2011 23:55:25 +0200 Subject: [PATCH 1/3] Don't show 0 if index cardinality is unknown --- libraries/Index.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Index.class.php b/libraries/Index.class.php index ee266aa137..13947ffb3a 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -635,7 +635,7 @@ class PMA_Index_Column * * @var integer */ - protected $_cardinality = 0; + protected $_cardinality = null; public function __construct($params = array()) { From 4c1cd515080dfa96e7dfeb231a1ec9ad55c4d293 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Sat, 18 Jun 2011 00:03:27 +0200 Subject: [PATCH 2/3] Display consistent information on table index's 'Null' field: 'Yes'/'No' instead of MySQL version dependent --- libraries/Index.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/Index.class.php b/libraries/Index.class.php index 13947ffb3a..7594f0c16a 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -504,7 +504,7 @@ class PMA_Index $r .= ''; $r .= '' . htmlspecialchars($column->getCardinality()) . ''; $r .= '' . htmlspecialchars($column->getCollation()) . ''; - $r .= '' . htmlspecialchars($column->getNull()) . ''; + $r .= '' . htmlspecialchars($column->getNull(true)) . ''; if ($column->getSeqInIndex() == 1) { $r .= '' @@ -679,9 +679,11 @@ class PMA_Index_Column return $this->_cardinality; } - public function getNull() + public function getNull($as_text = false) { - return $this->_null; + return $as_text + ? (!$this->_null || $this->_null == 'NO' ? __('No') : __('Yes')) + : $this->_null; } public function getSeqInIndex() From 1f10c9b961f1ea62ae5903a321d2c9bca022e8ea Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Sat, 18 Jun 2011 00:04:35 +0200 Subject: [PATCH 3/3] Fix incorrect array key (non_unique -> Non_unique) in qbe --- db_qbe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_qbe.php b/db_qbe.php index a5bd7a7e4e..42f6123d71 100644 --- a/db_qbe.php +++ b/db_qbe.php @@ -759,7 +759,7 @@ if (isset($Field) && count($Field) > 0) { while ($ind = PMA_DBI_fetch_assoc($ind_rs)) { $col1 = $tab . '.' . $ind['Column_name']; if (isset($col_all[$col1])) { - if ($ind['non_unique'] == 0) { + if ($ind['Non_unique'] == 0) { if (isset($col_where[$col1])) { $col_unique[$col1] = 'Y'; } else {