From a91f4762e4717e78416d4e39cf910b29716b5b01 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 31 Mar 2007 13:07:59 +0000 Subject: [PATCH] bug #1690718 Can't edit if BLOB and no PK --- ChangeLog | 2 ++ libraries/common.lib.php | 3 +++ libraries/display_tbl.lib.php | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 76ec78f20..0de130c2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,8 @@ $HeadURL$ - bug #1679055 #1050 - Table '' already exists - patch #1681620 [interface] support reordering of $cfg['ColumnTypes'], thanks to Leonard den Ottolander +- bug #1690718 Can't edit if BLOB and no PK + 2.10.0.3 (not released yet) ===================== diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 9f206da5f..432871c77 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2268,6 +2268,9 @@ if (typeof(window.parent) != 'undefined' $condition .= '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY) AND'; } + } else { + // this blob won't be part of the final condition + $condition = ''; } } else { $condition .= '= \'' diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index daa818fcd..11ab92e40 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -1066,6 +1066,12 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) { // 1. Prepares the row (gets primary keys to use) // 1.1 Results from a "SELECT" statement -> builds the // "primary" key to use in links + /** + * @todo $unique_condition could be empty, for example a table + * with only one field and it's a BLOB; in this case, + * avoid to display the delete and edit links + */ + $unique_condition = urlencode(PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row)); // 1.2 Defines the urls for the modify/delete link(s)