diff --git a/ChangeLog b/ChangeLog index e95d0dff1..5d4d29cac 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-01-21 Michal Cihar + * db_datadict.php3, pdf_schema.php3, tbl_printview.php3, + tbl_properties.inc.php3, tbl_properties_structure.php3, tbl_select.php3: + Fixed bug #667682 ("UNSIGNED" option in SET or ENUM), SET and ENUM can't + be SIGNED/UNSIGNED/ZEROFILL. + 2003-01-19 Alexander M. Turek * server_privileges.php3: Added column privileges editor. TODO: Deselection of all columns is not possible yet... diff --git a/db_datadict.php3 b/db_datadict.php3 index 9e971c3af..41a56b8d7 100644 --- a/db_datadict.php3 +++ b/db_datadict.php3 @@ -186,19 +186,22 @@ while ($row = mysql_fetch_array($rowset)) { $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type_nowrap = ''; - } else { - $type_nowrap = ' nowrap="nowrap"'; - } - $type = eregi_replace('BINARY', '', $type); - $type = eregi_replace('ZEROFILL', '', $type); - $type = eregi_replace('UNSIGNED', '', $type); - if (empty($type)) { - $type = ' '; - } - $binary = eregi('BINARY', $row['Type'], $test); - $unsigned = eregi('UNSIGNED', $row['Type'], $test); - $zerofill = eregi('ZEROFILL', $row['Type'], $test); + $binary = 0; + $unsigned = 0; + $zerofill = 0; + } else { + $binary = eregi('BINARY', $row['Type'], $test); + $unsigned = eregi('UNSIGNED', $row['Type'], $test); + $zerofill = eregi('ZEROFILL', $row['Type'], $test); + $type_nowrap = ' nowrap="nowrap"'; + $type = eregi_replace('BINARY', '', $type); + $type = eregi_replace('ZEROFILL', '', $type); + $type = eregi_replace('UNSIGNED', '', $type); + if (empty($type)) { + $type = ' '; + } + } $strAttribute = ' '; if ($binary) { $strAttribute = 'BINARY'; diff --git a/pdf_schema.php3 b/pdf_schema.php3 index 8fe29a139..df8be6236 100644 --- a/pdf_schema.php3 +++ b/pdf_schema.php3 @@ -1384,19 +1384,23 @@ function PMA_RT_DOC($alltables ){ $tmp[2] = substr(ereg_replace("([^,])''", "\\1\\'", ',' . $tmp[2]), 1); $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type_nowrap = ''; + + $binary = 0; + $unsigned = 0; + $zerofill = 0; } else { $type_nowrap = ' nowrap="nowrap"'; - } - $type = eregi_replace('BINARY', '', $type); - $type = eregi_replace('ZEROFILL', '', $type); - $type = eregi_replace('UNSIGNED', '', $type); - if (empty($type)) { - $type = ' '; - } + $type = eregi_replace('BINARY', '', $type); + $type = eregi_replace('ZEROFILL', '', $type); + $type = eregi_replace('UNSIGNED', '', $type); + if (empty($type)) { + $type = ' '; + } - $binary = eregi('BINARY', $row['Type'], $test); - $unsigned = eregi('UNSIGNED', $row['Type'], $test); - $zerofill = eregi('ZEROFILL', $row['Type'], $test); + $binary = eregi('BINARY', $row['Type'], $test); + $unsigned = eregi('UNSIGNED', $row['Type'], $test); + $zerofill = eregi('ZEROFILL', $row['Type'], $test); + } $strAttribute = ' '; if ($binary) { $strAttribute = 'BINARY'; diff --git a/tbl_printview.php3 b/tbl_printview.php3 index 94d1ed402..c2a27a4bb 100755 --- a/tbl_printview.php3 +++ b/tbl_printview.php3 @@ -204,19 +204,23 @@ while (list($key, $table) = each($the_tables)) { $tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); $type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')'; $type_nowrap = ''; + + $binary = 0; + $unsigned = 0; + $zerofill = 0; } else { $type_nowrap = ' nowrap="nowrap"'; - } - $type = eregi_replace('BINARY', '', $type); - $type = eregi_replace('ZEROFILL', '', $type); - $type = eregi_replace('UNSIGNED', '', $type); - if (empty($type)) { - $type = ' '; - } + $type = eregi_replace('BINARY', '', $type); + $type = eregi_replace('ZEROFILL', '', $type); + $type = eregi_replace('UNSIGNED', '', $type); + if (empty($type)) { + $type = ' '; + } - $binary = eregi('BINARY', $row['Type'], $test); - $unsigned = eregi('UNSIGNED', $row['Type'], $test); - $zerofill = eregi('ZEROFILL', $row['Type'], $test); + $binary = eregi('BINARY', $row['Type'], $test); + $unsigned = eregi('UNSIGNED', $row['Type'], $test); + $zerofill = eregi('ZEROFILL', $row['Type'], $test); + } $strAttribute = ' '; if ($binary) { $strAttribute = 'BINARY'; diff --git a/tbl_properties.inc.php3 b/tbl_properties.inc.php3 index e1b157991..3e626d9d2 100755 --- a/tbl_properties.inc.php3 +++ b/tbl_properties.inc.php3 @@ -87,14 +87,15 @@ for ($i = 0 ; $i < $num_fields; $i++) { else { $type = $row['Type']; } - $type = eregi_replace('BINARY', '', $type); - $type = eregi_replace('ZEROFILL', '', $type); - $type = eregi_replace('UNSIGNED', '', $type); // set or enum types: slashes single quotes inside options if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) { $type = $tmp[1]; $length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1); } else { + $type = eregi_replace('BINARY', '', $type); + $type = eregi_replace('ZEROFILL', '', $type); + $type = eregi_replace('UNSIGNED', '', $type); + $length = $type; $type = chop(eregi_replace('\\(.*\\)', '', $type)); if (!empty($type)) { @@ -132,9 +133,15 @@ for ($i = 0 ; $i < $num_fields; $i++) {