bug #1438999 updating a multi-table view
This commit is contained in:
@@ -573,7 +573,8 @@ foreach ($loop_array AS $vrowcount => $vrow) {
|
||||
|
||||
echo ' <input type="hidden" name="fields_null_prev' . $vkey . '[' . urlencode($field) . ']"';
|
||||
if ($real_null_value && !$first_timestamp) {
|
||||
echo ' checked="checked"';
|
||||
//echo ' checked="checked"';
|
||||
echo ' value="on"';
|
||||
}
|
||||
echo ' />' . "\n";
|
||||
|
||||
|
@@ -168,13 +168,15 @@ foreach ($loop_array AS $primary_key_index => $enc_primary_key) {
|
||||
$cur_value = $me_funcs[$encoded_key] . '(' . $val . '), ';
|
||||
}
|
||||
|
||||
// i n s e r t
|
||||
if ($is_insert) {
|
||||
// insert, no need to add column
|
||||
// no need to add column into the valuelist
|
||||
$valuelist .= $cur_value;
|
||||
} elseif (isset($me_fields_null_prev) && isset($me_fields_null_prev[$encoded_key]) && !isset($me_fields_null[$encoded_key])) {
|
||||
// field had the null checkbox
|
||||
|
||||
// u p d a t e
|
||||
} elseif (isset($me_fields_null_prev) && isset($me_fields_null_prev[$encoded_key]) && !empty($me_fields_null_prev[$encoded_key]) && !isset($me_fields_null[$encoded_key])) {
|
||||
// field had the null checkbox before the update
|
||||
// field no longer has the null checkbox
|
||||
// field does not have the same value
|
||||
$valuelist .= PMA_backquote($key) . ' = ' . $cur_value;
|
||||
} elseif (empty($me_funcs[$encoded_key])
|
||||
&& isset($me_fields_prev) && isset($me_fields_prev[$encoded_key])
|
||||
@@ -182,9 +184,13 @@ foreach ($loop_array AS $primary_key_index => $enc_primary_key) {
|
||||
// No change for this column and no MySQL function is used -> next column
|
||||
continue;
|
||||
} elseif (!empty($val)) {
|
||||
// TODO: avoid setting a field to NULL when it's already NULL
|
||||
// avoid setting a field to NULL when it's already NULL
|
||||
// (field had the null checkbox before the update
|
||||
// field still has the null checkbox)
|
||||
if (!(isset($me_fields_null_prev) && isset($me_fields_null_prev[$encoded_key]) && !empty($me_fields_null_prev[$encoded_key]) && isset($me_fields_null[$encoded_key]))) {
|
||||
$valuelist .= PMA_backquote($key) . ' = ' . $cur_value;
|
||||
}
|
||||
}
|
||||
} // end while
|
||||
|
||||
// get rid of last ,
|
||||
|
Reference in New Issue
Block a user