Problems with latest fix and SET columns

This commit is contained in:
Marc Delisle
2010-12-17 09:31:42 -05:00
parent 4a71a1e5f1
commit 45ec0da621
2 changed files with 25 additions and 38 deletions

View File

@@ -69,22 +69,18 @@ if (false !== $possibly_uploaded_val) {
// $key contains the md5() of the fieldname // $key contains the md5() of the fieldname
if (0 === strlen($val)) { if (0 === strlen($val)) {
// default // best way to avoid problems in strict mode (works also in non-strict mode)
if (isset($me_auto_increment) && isset($me_auto_increment[$key])) {
$val = 'NULL';
} else {
$val = "''"; $val = "''";
}
switch ($type) { } elseif ($type == 'set') {
case 'enum':
// if we have an enum, then construct the value
case 'set':
// if we have a set, then construct the value
case 'foreign':
// if we have a foreign key, then construct the value
if (! empty($_REQUEST['fields']['multi_edit'][$rownumber][$key])) { if (! empty($_REQUEST['fields']['multi_edit'][$rownumber][$key])) {
$val = implode(',', $_REQUEST['fields']['multi_edit'][$rownumber][$key]); $val = implode(',', $_REQUEST['fields']['multi_edit'][$rownumber][$key]);
$val = "'" . PMA_sqlAddslashes($val) . "'"; $val = "'" . PMA_sqlAddslashes($val) . "'";
} }
break; } elseif ($type == 'protected') {
case 'protected':
// here we are in protected mode (asked in the config) // here we are in protected mode (asked in the config)
// so tbl_change has put this special value in the // so tbl_change has put this special value in the
// fields array, so we do not change the field value // fields array, so we do not change the field value
@@ -98,15 +94,6 @@ if (false !== $possibly_uploaded_val) {
} else { } else {
$val = ''; $val = '';
} }
break;
default:
// best way to avoid problems in strict mode (works also in non-strict mode)
if (isset($me_auto_increment) && isset($me_auto_increment[$key])) {
$val = 'NULL';
}
break;
}
} elseif ($type == 'bit') { } elseif ($type == 'bit') {
$val = preg_replace('/[^01]/', '0', $val); $val = preg_replace('/[^01]/', '0', $val);
$val = "b'" . PMA_sqlAddslashes($val) . "'"; $val = "b'" . PMA_sqlAddslashes($val) . "'";

View File

@@ -804,7 +804,7 @@ foreach ($rows as $row_id => $vrow) {
echo $backup_field . "\n"; echo $backup_field . "\n";
?> ?>
<input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="set" /> <input type="hidden" name="fields_type<?php echo $field_name_appendix; ?>" value="set" />
<select name="fields<?php echo $field_name_appendix; ?>" <select name="fields<?php echo $field_name_appendix . '[]'; ?>"
class="textfield" class="textfield"
size="<?php echo $select_size; ?>" size="<?php echo $select_size; ?>"
multiple="multiple" <?php echo $unnullify_trigger; ?> multiple="multiple" <?php echo $unnullify_trigger; ?>