From 4232fcd458b70913a08240897cde0073c6e78959 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Sat, 10 Sep 2011 10:47:37 +0530 Subject: [PATCH] bug #3403165 [interface] Collation not displayed for long enum fields --- ChangeLog | 1 + tbl_structure.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 756651106..9949461c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ phpMyAdmin - ChangeLog 3.4.6.0 (not yet released) - patch #3404173 InnoDB comment display with tooltips/aliases - bug #3404886 [navi] Edit SQL statement after error +- bug #3403165 [interface] Collation not displayed for long enum fields 3.4.5.0 (not yet released) - bug #3375325 [interface] Page list in navigation frame looks odd diff --git a/tbl_structure.php b/tbl_structure.php index 4c0b1856b..8e7e5cd90 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -245,6 +245,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { $type = $row['Type']; $extracted_fieldspec = PMA_extractFieldSpec($row['Type']); + $truncated = false; if ('set' == $extracted_fieldspec['type'] || 'enum' == $extracted_fieldspec['type']) { $type = $extracted_fieldspec['type'] . '(' . str_replace("','", "', '", $extracted_fieldspec['spec_in_brackets']) . ')'; @@ -252,6 +253,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { // for the case ENUM('–','“') $type = htmlspecialchars($type); if(strlen($type) > $GLOBALS['cfg']['LimitChars']) { + $truncated = true; $type = '' . substr($type, 0, $GLOBALS['cfg']['LimitChars']) . ''; } @@ -292,6 +294,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) { || substr($type, 0, 8) == 'longtext' || substr($type, 0, 3) == 'set' || substr($type, 0, 4) == 'enum' + || ($truncated && substr($type, 13, 4) == 'enum') ) && !$binary) { if (strpos($type, ' character set ')) { $type = substr($type, 0, strpos($type, ' character set '));