bug 1190092, wrong detection of NULL fields with MySQL 5.0.x

This commit is contained in:
Marc Delisle
2005-04-26 16:05:30 +00:00
parent 450f13064c
commit 6bedb51f28
3 changed files with 10 additions and 6 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2005-04-26 Marc Delisle <lem9@users.sourceforge.net>
* tbl_properties_structure.php, tbl_properties.inc.php:
bug #1190092, wrong detection of NULL fields with MySQL 5.0.x
2005-04-25 Marc Delisle <lem9@users.sourceforge.net>
* libraries/sqlparser*: bug #1185173. A query using the Storage
table name and an alias, returned no result. I changed the

View File

@@ -373,13 +373,13 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$content_cells[$i][$ci] = '<select name="field_null[]" id="field_' . $i . '_' . ($ci - $ci_offset) . '">';
if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) {
if ((!isset($row) || empty($row['Null']) || $row['Null'] == 'NO' || $row['Null'] == 'NOT NULL') && $submit_null == FALSE) {
$content_cells[$i][$ci] .= "\n";
$content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
$content_cells[$i][$ci] .= ' <option value="NOT NULL" selected="selected" >not null</option>' . "\n";
$content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
} else {
$content_cells[$i][$ci] .= "\n";
$content_cells[$i][$ci] .= ' <option value="">null</option>' . "\n";
$content_cells[$i][$ci] .= ' <option value="" selected="selected" >null</option>' . "\n";
$content_cells[$i][$ci] .= ' <option value="NOT NULL">not null</option>' . "\n";
}
@@ -387,7 +387,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
$ci++;
if (isset($row)
&& !isset($row['Default']) && !empty($row['Null'])) {
&& !isset($row['Default']) && isset($row['Null']) && $row['Null'] == 'YES') {
$row['Default'] = 'NULL';
}

View File

@@ -248,7 +248,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
}
if (!isset($row['Default'])) {
if ($row['Null'] != '') {
if ($row['Null'] == 'YES') {
$row['Default'] = '<i>NULL</i>';
}
} else {
@@ -336,7 +336,7 @@ while ($row = PMA_DBI_fetch_assoc($fields_rs)) {
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"<?php echo $type_nowrap; ?>><?php echo $type; echo $type_mime; ?><bdo dir="ltr"></bdo></td>
<?php echo PMA_MYSQL_INT_VERSION >= 40100 ? ' <td bgcolor="' . $bgcolor . '" ' . $click_mouse . '>' . (empty($field_charset) ? '&nbsp;' : '<dfn title="' . PMA_getCollationDescr($field_charset) . '">' . $field_charset . '</dfn>') . '</td>' . "\n" : '' ?>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap" style="font-size: <?php echo $font_smallest; ?>"><?php echo $attribute; ?></td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == '') ? $strNo : $strYes); ?>&nbsp;</td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>"><?php echo (($row['Null'] == 'YES') ? $strYes : $strNo); ?>&nbsp;</td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php if (isset($row['Default'])) echo $row['Default']; ?>&nbsp;</td>
<td <?php echo $click_mouse; ?> bgcolor="<?php echo $bgcolor; ?>" nowrap="nowrap"><?php echo $row['Extra']; ?>&nbsp;</td>
<?php