bug #1451426, edit breaks protected BLOB field, changes it from NULL to empty string

This commit is contained in:
Marc Delisle
2006-05-26 17:46:23 +00:00
parent b70a1f8820
commit bc42d746b4
2 changed files with 34 additions and 25 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - ChangeLog
$Id$ $Id$
$Source$ $Source$
2006-05-26 Marc Delisle <lem9@users.sourceforge.net>
* tbl_change.php: bug #1451426, edit breaks protected BLOB field,
changes it from NULL to empty string
2006-05-23 Marc Delisle <lem9@users.sourceforge.net> 2006-05-23 Marc Delisle <lem9@users.sourceforge.net>
* tbl_change.php, tbl_replace.php: bug #1438999, updating a multi-table * tbl_change.php, tbl_replace.php: bug #1438999, updating a multi-table
view view

View File

@@ -565,43 +565,48 @@ foreach ($loop_array AS $vrowcount => $vrow) {
} }
} // end if ($cfg['ShowFunctionFields']) } // end if ($cfg['ShowFunctionFields'])
// The null column // The null column
// --------------- // ---------------
echo ' <td>' . "\n"; echo ' <td>' . "\n";
if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) if ($row_table_def['Null'] == 'YES') {
&& $row_table_def['Null'] == 'YES') {
echo ' <input type="hidden" name="fields_null_prev' . $vkey . '[' . urlencode($field) . ']"'; echo ' <input type="hidden" name="fields_null_prev' . $vkey . '[' . urlencode($field) . ']"';
if ($real_null_value && !$first_timestamp) { if ($real_null_value && !$first_timestamp) {
//echo ' checked="checked"';
echo ' value="on"'; echo ' value="on"';
} }
echo ' />' . "\n"; echo ' />' . "\n";
echo ' <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"' if (!(($cfg['ProtectBinary'] && $is_blob) || ($cfg['ProtectBinary'] == 'all' && $is_binary)) ) {
. ' name="fields_null' . $vkey . '[' . urlencode($field) . ']"';
if ($real_null_value && !$first_timestamp) { echo ' <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"'
echo ' checked="checked"'; . ' name="fields_null' . $vkey . '[' . urlencode($field) . ']"';
} if ($real_null_value && !$first_timestamp) {
echo ' id="field_' . ($idindex) . '_2"'; echo ' checked="checked"';
$onclick = ' onclick="if (this.checked) {nullify(';
if (strstr($row_table_def['True_Type'], 'enum')) {
if (strlen($row_table_def['Type']) > 20) {
$onclick .= '1, ';
} else {
$onclick .= '2, ';
} }
} elseif (strstr($row_table_def['True_Type'], 'set')) { echo ' id="field_' . ($idindex) . '_2"';
$onclick .= '3, '; $onclick = ' onclick="if (this.checked) {nullify(';
} elseif ($foreigners && isset($foreigners[$field])) { if (strstr($row_table_def['True_Type'], 'enum')) {
$onclick .= '4, '; if (strlen($row_table_def['Type']) > 20) {
$onclick .= '1, ';
} else {
$onclick .= '2, ';
}
} elseif (strstr($row_table_def['True_Type'], 'set')) {
$onclick .= '3, ';
} elseif ($foreigners && isset($foreigners[$field])) {
$onclick .= '4, ';
} else {
$onclick .= '5, ';
}
$onclick .= '\'' . urlencode($field) . '\', \'' . md5($field) . '\', \'' . $vkey . '\'); this.checked = true}; return true" />' . "\n";
echo $onclick;
} else { } else {
$onclick .= '5, '; echo ' <input type="hidden" name="fields_null' . $vkey . '[' . urlencode($field) . ']"';
if ($real_null_value && !$first_timestamp) {
echo ' value="on"';
}
echo ' />' . "\n";
} }
$onclick .= '\'' . urlencode($field) . '\', \'' . md5($field) . '\', \'' . $vkey . '\'); this.checked = true}; return true" />' . "\n";
echo $onclick;
} else {
echo ' &nbsp;' . "\n";
} }
echo ' </td>' . "\n"; echo ' </td>' . "\n";