diff --git a/ChangeLog b/ChangeLog index 169417eaa9..06f1b9dcb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA thanks to Mario Rohkrämer - Do not display "Your MySQL library..." if only the Z part of X.Y.Z version is different +- bugs #1767759, 1216521 [data] Duplicate entry error Browse feature: this minor + feature removed due to its complexity 2.11.0.0 (2007-08-21) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 9dfdd206e6..b7c26e1255 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -542,62 +542,6 @@ function PMA_mysqlDie($error_message = '', $the_query = '', echo '' . "\n" . $error_message . "\n" . '
' . "\n"; - - // feature request #1036254: - // Add a link by MySQL-Error #1062 - Duplicate entry - // 2004-10-20 by mkkeck - // 2005-01-17 modified by mkkeck bugfix - if (substr($error_message, 1, 4) == '1062') { - // get the duplicate entry - - // get table name - /** - * @todo what would be the best delimiter, while avoiding special - * characters that can become high-ascii after editing, depending - * upon which editor is used by the developer? - */ - $error_table = array(); - if (preg_match('@ALTER\s*TABLE\s*\`([^\`]+)\`@iu', $the_query, $error_table)) { - $error_table = $error_table[1]; - } elseif (preg_match('@INSERT\s*INTO\s*\`([^\`]+)\`@iu', $the_query, $error_table)) { - $error_table = $error_table[1]; - } elseif (preg_match('@UPDATE\s*\`([^\`]+)\`@iu', $the_query, $error_table)) { - $error_table = $error_table[1]; - } elseif (preg_match('@INSERT\s*\`([^\`]+)\`@iu', $the_query, $error_table)) { - $error_table = $error_table[1]; - } - - // get fields - $error_fields = array(); - if (preg_match('@\(([^\)]+)\)@i', $the_query, $error_fields)) { - $error_fields = explode(',', $error_fields[1]); - } elseif (preg_match('@(`[^`]+`)\s*=@i', $the_query, $error_fields)) { - $error_fields = explode(',', $error_fields[1]); - } - if (is_array($error_table) || is_array($error_fields)) { - - // duplicate value - $duplicate_value = array(); - preg_match('@\'([^\']+)\'@i', $tmp_mysql_error, $duplicate_value); - $duplicate_value = $duplicate_value[1]; - - $sql = ' - SELECT * - FROM ' . PMA_backquote($error_table) . ' - WHERE CONCAT_WS("-", ' . implode(', ', $error_fields) . ') - = "' . PMA_sqlAddslashes($duplicate_value) . '" - ORDER BY ' . implode(', ', $error_fields); - unset($error_table, $error_fields, $duplicate_value); - - echo '
' ."\n" - .' ' . "\n" - .' ' . PMA_generate_common_hidden_inputs($db, $table) . "\n" - .' ' . "\n" - .'
' . "\n"; - unset($sql); - } - } // end of show duplicate entry - echo ''; echo '
';