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

@@ -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';
}