rfe #1516803 [edit] Allow to set BLOB to/from NULL with ProtectBinary.

This commit is contained in:
Michal Čihař
2010-01-22 17:20:35 +00:00
parent 98b61946eb
commit e532069912
3 changed files with 27 additions and 35 deletions

View File

@@ -30,6 +30,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
+ [interface] Allow to create new table from navigation frame (in light mode).
+ rfe #1025696 [browse] Add direct download of binary fields.
- [browse] Properly display NULL value for BLOB.
- rfe #1516803 [edit] Allow to set BLOB to/from NULL with ProtectBinary.
3.3.0.0 (not yet released)
+ rfe #2308632 [edit] Use hex for (var)binary fields,

View File

@@ -121,7 +121,7 @@ if (false !== $possibly_uploaded_val) {
// (if there is a value, we ignore the Null checkbox: this could
// be possible if Javascript is disabled in the browser)
if (isset($me_fields_null[$key])
&& $val == "''") {
&& ($val == "''" || $val == '')) {
$val = 'NULL';
}

View File

@@ -597,41 +597,32 @@ foreach ($rows as $row_id => $vrow) {
}
echo ' />' . "\n";
if (!(($cfg['ProtectBinary'] && $field['is_blob']) || ($cfg['ProtectBinary'] == 'all' && $field['is_binary']))) {
echo ' <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"'
. ' name="fields_null' . $field_name_appendix . '"';
if ($real_null_value && !$field['first_timestamp']) {
echo ' checked="checked"';
}
echo ' id="field_' . ($idindex) . '_2"';
$onclick = ' onclick="if (this.checked) {nullify(';
if (strstr($field['True_Type'], 'enum')) {
if (strlen($field['Type']) > 20) {
$onclick .= '1, ';
} else {
$onclick .= '2, ';
}
} elseif (strstr($field['True_Type'], 'set')) {
$onclick .= '3, ';
} elseif ($foreigners && isset($foreigners[$field['Field']]) && $foreignData['foreign_link'] == false) {
// foreign key in a drop-down
$onclick .= '4, ';
} elseif ($foreigners && isset($foreigners[$field['Field']]) && $foreignData['foreign_link'] == true) {
// foreign key with a browsing icon
$onclick .= '6, ';
} else {
$onclick .= '5, ';
}
$onclick .= '\'' . PMA_escapeJsString($field['Field_html']) . '\', \'' . $field['Field_md5'] . '\', \'' . PMA_escapeJsString($vkey) . '\'); this.checked = true}; return true" />' . "\n";
echo $onclick;
} else {
echo ' <input type="hidden" name="fields_null' . $field_name_appendix . '"';
if ($real_null_value && !$field['first_timestamp']) {
echo ' value="on"';
}
echo ' />' . "\n";
echo ' <input type="checkbox" tabindex="' . ($tabindex + $tabindex_for_null) . '"'
. ' name="fields_null' . $field_name_appendix . '"';
if ($real_null_value && !$field['first_timestamp']) {
echo ' checked="checked"';
}
echo ' id="field_' . ($idindex) . '_2"';
$onclick = ' onclick="if (this.checked) {nullify(';
if (strstr($field['True_Type'], 'enum')) {
if (strlen($field['Type']) > 20) {
$onclick .= '1, ';
} else {
$onclick .= '2, ';
}
} elseif (strstr($field['True_Type'], 'set')) {
$onclick .= '3, ';
} elseif ($foreigners && isset($foreigners[$field['Field']]) && $foreignData['foreign_link'] == false) {
// foreign key in a drop-down
$onclick .= '4, ';
} elseif ($foreigners && isset($foreigners[$field['Field']]) && $foreignData['foreign_link'] == true) {
// foreign key with a browsing icon
$onclick .= '6, ';
} else {
$onclick .= '5, ';
}
$onclick .= '\'' . PMA_escapeJsString($field['Field_html']) . '\', \'' . $field['Field_md5'] . '\', \'' . PMA_escapeJsString($vkey) . '\'); this.checked = true}; return true" />' . "\n";
echo $onclick;
}
echo ' </td>' . "\n";