bug #1690718 Can't edit if BLOB and no PK

This commit is contained in:
Marc Delisle
2007-03-31 13:08:50 +00:00
parent f124554ab1
commit 8da1b5a730
3 changed files with 9 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- bug #1679055 #1050 - Table '<table name>' already exists - bug #1679055 #1050 - Table '<table name>' already exists
- patch #1681620 [interface] support reordering of $cfg['ColumnTypes'], - patch #1681620 [interface] support reordering of $cfg['ColumnTypes'],
thanks to Leonard den Ottolander thanks to Leonard den Ottolander
- bug #1690718 Can't edit if BLOB and no PK
2.10.0.3 (not released yet) 2.10.0.3 (not released yet)
===================== =====================

View File

@@ -1927,6 +1927,9 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
$condition .= '= CAST(0x' . bin2hex($row[$i]) $condition .= '= CAST(0x' . bin2hex($row[$i])
. ' AS BINARY) AND'; . ' AS BINARY) AND';
} }
} else {
// this blob won't be part of the final condition
$condition = '';
} }
} else { } else {
$condition .= '= \'' $condition .= '= \''

View File

@@ -1072,6 +1072,11 @@ function PMA_displayTableBody(&$dt_result, &$is_display, $map, $analyzed_sql) {
// 1. Prepares the row (gets primary keys to use) // 1. Prepares the row (gets primary keys to use)
// 1.1 Results from a "SELECT" statement -> builds the // 1.1 Results from a "SELECT" statement -> builds the
// "primary" key to use in links // "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)); $unique_condition = urlencode(PMA_getUniqueCondition($dt_result, $fields_cnt, $fields_meta, $row));
// 1.2 Defines the urls for the modify/delete link(s) // 1.2 Defines the urls for the modify/delete link(s)