1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-11 17:14:07 +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

@@ -332,6 +332,14 @@ if (!$columns) {
foreach ($adminer->rowDescriptions($rows, $foreign_keys) as $n => $row) {
$unique_array = unique_array($rows[$n], $indexes);
if (!$unique_array) {
$unique_array = array();
foreach ($rows[$n] as $key => $val) {
if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]|``)+`\\))$~', $key)) { //! columns looking like functions
$unique_array[$key] = $val;
}
}
}
$unique_idf = "";
foreach ($unique_array as $key => $val) {
if (strlen($val) > 64) {