undefined $primary_field
This commit is contained in:
@@ -473,4 +473,35 @@ function PMA_BS_getURL($reference)
|
|||||||
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
|
$bs_url = 'http://' . $bs_server . '/' . rtrim($reference);
|
||||||
return $bs_url;
|
return $bs_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* returns the field name for a primary key of a given table in a given database
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string - database name
|
||||||
|
* @param string - table name
|
||||||
|
* @uses PMA_DBI_select_db()
|
||||||
|
* @uses PMA_backquote()
|
||||||
|
* @uses PMA_DBI_query()
|
||||||
|
* @uses PMA_DBI_fetch_assoc()
|
||||||
|
* @return string - field name for primary key
|
||||||
|
*/
|
||||||
|
function PMA_BS_GetPrimaryField($db_name, $tbl_name)
|
||||||
|
{
|
||||||
|
// select specified database
|
||||||
|
PMA_DBI_select_db($db_name);
|
||||||
|
|
||||||
|
// retrieve table fields
|
||||||
|
$query = "SHOW FULL FIELDS FROM " . PMA_backquote($tbl_name);
|
||||||
|
$result = PMA_DBI_query($query);
|
||||||
|
|
||||||
|
// while there are records to parse
|
||||||
|
while ($data = PMA_DBI_fetch_assoc($result)) {
|
||||||
|
if ("PRI" == $data['Key']) {
|
||||||
|
return $data['Field'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// return NULL on no primary key
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@@ -210,6 +210,10 @@ foreach ($loop_array as $rowcount => $where_clause) {
|
|||||||
? $_REQUEST['auto_increment']['multi_edit'][$rowcount]
|
? $_REQUEST['auto_increment']['multi_edit'][$rowcount]
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
if ($blob_streaming_active) {
|
||||||
|
$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
|
// 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
|
// @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($where_clause)) {
|
if ($is_insert && $using_key && isset($me_fields_type) && is_array($me_fields_type) && isset($where_clause)) {
|
||||||
|
Reference in New Issue
Block a user