diff --git a/ChangeLog b/ChangeLog index 5381f0fb01..0ab1f6ed33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ phpMyAdmin - ChangeLog - bug #4878 Column list of central columns is not cleared - bug #4881 jQuery dialogs of the Designer are not displayed in fullscreen - bug #4883 Search function breaks when searching for certain combinations of backslashes and slashes +- bug #4830 Maximum execution time exceeded in Util.class.php (better fix) 4.4.4.0 (2015-04-26) - bug #4863 Edit vs Change diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 2dda4b51c5..217fd784f8 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -2839,6 +2839,8 @@ class PMA_DisplayResults $row_info = $this->_getRowInfoForSpecialLinks($row, $col_order); + $previousMetaOrgTable = ''; + $columnCount = $this->__get('fields_cnt'); for ($currentColumn = 0; $currentColumn < $columnCount; @@ -2984,14 +2986,25 @@ class PMA_DisplayResults 'transform_key' => $meta->name, ); - $unique_conditions = PMA_Util::getUniqueCondition( - $dt_result, - $this->__get('fields_cnt'), - $this->__get('fields_meta'), - $row, - false, - $meta->orgtable - ); + /* + * The result set can have columns from more than one table, + * this is why we have to check for the unique conditions + * related to this table; however getUniqueCondition() is + * costly and does not need to be called if we already know + * the conditions for the current table. + */ + + if ($meta->orgtable != $previousMetaOrgTable) { + $unique_conditions = PMA_Util::getUniqueCondition( + $dt_result, + $this->__get('fields_cnt'), + $this->__get('fields_meta'), + $row, + false, + $meta->orgtable + ); + $previousMetaOrgTable = $meta->orgtable; + } $transform_url_params = array( 'db' => $this->__get('db'),