diff --git a/ChangeLog b/ChangeLog index cf1a6882f..f2550028e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,6 +55,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #2565948 [core] Changing the connection collation changed the client charset. + [lang] Romanian update, thanks to Sergiu Bivol - sbivol +- patch #1760205 [data] Insert as new row: BLOB is lost, + thanks to Herman van Rink - helmo 3.1.2.0 (2009-01-19) - bug #1253252 [display] Can't NULL a column with relation defined diff --git a/libraries/tbl_replace_fields.inc.php b/libraries/tbl_replace_fields.inc.php index 9456d9996..731fe4191 100644 --- a/libraries/tbl_replace_fields.inc.php +++ b/libraries/tbl_replace_fields.inc.php @@ -68,7 +68,7 @@ if (false !== $possibly_uploaded_val) { $type = ''; } - // $key is and md5() of the fieldname + // $key contains the md5() of the fieldname $f = 'field_' . $key; if (0 === strlen($val)) { @@ -96,7 +96,7 @@ if (false !== $possibly_uploaded_val) { // garvin: when in UPDATE mode, do not alter field's contents. When in INSERT // mode, insert empty field because no values were submitted. If protected // blobs where set, insert original fields content. - if (! empty($prot_row[$key])) { + if (! empty($prot_row[$me_fields_name[$key]])) { $val = '0x' . bin2hex($prot_row[$me_fields_name[$key]]); } else { $val = ''; diff --git a/tbl_replace.php b/tbl_replace.php index 67a5604f3..526c70308 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -207,6 +207,16 @@ foreach ($loop_array as $rowcount => $primary_key) { $primary_field = PMA_BS_GetPrimaryField($GLOBALS['db'], $GLOBALS['table']); + // Fetch the current values of a row to use in case we have a protected field + // @todo possibly move to ./libraries/tbl_replace_fields.inc.php + if ($is_insert && $using_key && isset($me_fields_type) && + is_array($me_fields_type) && isset($primary_key)) { + $prot_result = PMA_DBI_query('SELECT * FROM ' . + PMA_backquote($table) . ' WHERE ' . $primary_key . ';'); + $prot_row = PMA_DBI_fetch_assoc($prot_result); + PMA_DBI_free_result($prot_result); + unset($prot_result); + } foreach ($me_fields as $key => $val) { // Note: $key is an md5 of the fieldname. The actual fieldname is available in $me_fields_name[$key]