From 279a8f8f21dfdd595e05fe8cc570caf723b18445 Mon Sep 17 00:00:00 2001 From: Barry Leslie Date: Fri, 23 Jul 2010 08:06:24 -0700 Subject: [PATCH] The use of PBMS is not dependent on a primary key --- libraries/blobstreaming.lib.php | 30 ------------------------------ tbl_replace.php | 6 +----- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/libraries/blobstreaming.lib.php b/libraries/blobstreaming.lib.php index 17a05e08f..b0938521c 100644 --- a/libraries/blobstreaming.lib.php +++ b/libraries/blobstreaming.lib.php @@ -494,34 +494,4 @@ function PMA_BS_getURL($reference) 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; -} ?> diff --git a/tbl_replace.php b/tbl_replace.php index 92331b9c3..6d4fd83da 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -210,10 +210,6 @@ foreach ($loop_array as $rowcount => $where_clause) { ? $_REQUEST['auto_increment']['multi_edit'][$rowcount] : 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 // @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)) { @@ -226,7 +222,7 @@ foreach ($loop_array as $rowcount => $where_clause) { require './libraries/tbl_replace_fields.inc.php'; // for blobstreaming - if ($blob_streaming_active && (NULL != $primary_field || strlen($primary_field) > 0)) { + if ($blob_streaming_active) { $remove_blob_repo = isset($_REQUEST['remove_blob_repo_' . $key]) ? $_REQUEST['remove_blob_repo_' . $key] : NULL; $upload_blob_repo = isset($_REQUEST['upload_blob_repo_' . $key]) ? $_REQUEST['upload_blob_repo_' . $key] : NULL;