bug 556296

This commit is contained in:
Marc Delisle
2002-05-17 11:26:53 +00:00
parent a59ee12d66
commit cb213a9d06
2 changed files with 16 additions and 7 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-05-17 Marc Delisle <lem9@users.sourceforge.net>
* tbl_change.php3, bug 556296: field size for int
2002-05-17 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-05-17 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* db_details_structure.php3, lines 446-458; * db_details_structure.php3, lines 446-458;
tbl_properties_options.php3, lines 119-143: beautified generated code. tbl_properties_options.php3, lines 119-143: beautified generated code.

View File

@@ -1,7 +1,6 @@
<?php <?php
/* $Id$ */ /* $Id$ */
/** /**
* Get the variables sent or posted to this script and displays the header * Get the variables sent or posted to this script and displays the header
*/ */
@@ -182,6 +181,7 @@ for ($i = 0; $i < $fields_cnt; $i++) {
// The type column // The type column
$is_binary = eregi(' binary', $row_table_def['Type']); $is_binary = eregi(' binary', $row_table_def['Type']);
$is_blob = eregi('blob', $row_table_def['Type']); $is_blob = eregi('blob', $row_table_def['Type']);
$is_char = eregi('char', $row_table_def['Type']);
$row_table_def['True_Type'] = ereg_replace('\\(.*', '', $row_table_def['Type']); $row_table_def['True_Type'] = ereg_replace('\\(.*', '', $row_table_def['Type']);
switch ($row_table_def['True_Type']) { switch ($row_table_def['True_Type']) {
case 'set': case 'set':
@@ -459,12 +459,18 @@ for ($i = 0; $i < $fields_cnt; $i++) {
} // end if...elseif...else } // end if...elseif...else
} // end else if } // end else if
else { else {
if ($len < 4) {
$fieldsize = $maxlength = 4; // for char or varchar, respect the maximum length (M);
} else { // for other types (int or float), the length is not a limit on the values
$fieldsize = (($len > 40) ? 40 : $len); // that can be entered, so let's be generous (20)
$maxlength = $len; // (we could also use the real limits for each numeric type)
} if ($is_char) {
$fieldsize = (($len > 40) ? 40 : $len);
$maxlength = $len;
}
else {
$fieldsize = $maxlength = 20;
} // end if
echo "\n"; echo "\n";
?> ?>
<td bgcolor="<?php echo $bgcolor; ?>"> <td bgcolor="<?php echo $bgcolor; ?>">