From eb4e32a63e26c1019b66a7517bb351fde6957ffc Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Tue, 26 Jun 2007 11:53:09 +0000 Subject: [PATCH] bug #1733012 Unwanted table alias in delete button --- ChangeLog | 1 + libraries/common.lib.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58155ef72..56ea80e2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -76,6 +76,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #1722502 DROP TABLE in export VIEW - bug #1729027 Sorting results of VIEW browsing - bug #1727138 HTML not encoded (more than 1000 characters) +- bug #1733012 Unwanted table alias in delete button 2.10.2.0 (2007-06-15) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 61588ab81..d9b0f3fa3 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -1857,7 +1857,7 @@ function PMA_checkParameters($params, $die = true, $request = true) * @param boolean $force_unique generate condition only on pk or unique * * @access public - * @author Michal Cihar (michal@cihar.com) + * @author Michal Cihar (michal@cihar.com) and others... * @return string calculated condition */ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force_unique=false) @@ -1872,7 +1872,7 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force $field_flags = PMA_DBI_field_flags($handle, $i); $meta = $fields_meta[$i]; - // do not use an alias in a condition + // do not use a column alias in a condition if (! isset($meta->orgname) || ! strlen($meta->orgname)) { $meta->orgname = $meta->name; @@ -1890,6 +1890,10 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force } } + // do not use a table alias in a condition + if ($meta->table != $meta->orgtable) { + $meta->table = $meta->orgtable; + } // to fix the bug where float fields (primary or not) // can't be matched because of the imprecision of