1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 23:57:29 +02:00

Don't use LIMIT 1 if updating unique row (bug #3613109)

This commit is contained in:
Jakub Vrana
2013-05-11 13:03:39 -07:00
parent 2f996ba014
commit af30f59737
4 changed files with 26 additions and 10 deletions

View File

@@ -303,7 +303,7 @@ function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
/** Find unique identifier of a row
* @param array
* @param array result of indexes()
* @return array
* @return array or null if there is no unique identifier
*/
function unique_array($row, $indexes) {
foreach ($indexes as $index) {
@@ -318,13 +318,6 @@ function unique_array($row, $indexes) {
return $return;
}
}
$return = array();
foreach ($row as $key => $val) {
if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~', $key)) { //! columns looking like functions
$return[$key] = $val;
}
}
return $return;
}
/** Create SQL condition from parsed query string