diff --git a/adminer/edit.inc.php b/adminer/edit.inc.php index a5ab4ede..e556c038 100644 --- a/adminer/edit.inc.php +++ b/adminer/edit.inc.php @@ -1,6 +1,6 @@ $field) { if ((isset($_GET["default"]) ? $field["auto_increment"] || ereg('text|blob', $field["type"]) : !isset($field["privileges"][$update ? "update" : "insert"])) || !strlen($adminer->fieldName($field))) { @@ -38,7 +38,7 @@ if ($_POST && !$error && !isset($_GET["select"])) { $table_name = $adminer->tableName(table_status($_GET["edit"])); page_header( - (isset($_GET["default"]) ? lang('Default values') : ($_GET["where"] || (isset($_GET["select"]) && !$_POST["clone"]) ? lang('Edit') : lang('Insert'))), + (isset($_GET["default"]) ? lang('Default values') : ($update ? lang('Edit') : lang('Insert'))), $error, array((isset($_GET["default"]) ? "table" : "select") => array($_GET["edit"], $table_name)), $table_name diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index 4cde3c0d..a7c56d45 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -455,7 +455,7 @@ class Adminer { echo "
\n";
while ($row = $result->fetch_row()) {
echo '' . lang('select') . ' ';
- echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::table_name may work with full table status
+ echo '' . $this->tableName(array("Name" => $row[0])) . "
\n"; //! Adminer::tableName may work with full table status
}
}
$result->free();
diff --git a/adminer/include/functions.inc.php b/adminer/include/functions.inc.php
index 2b92a820..aeda28de 100644
--- a/adminer/include/functions.inc.php
+++ b/adminer/include/functions.inc.php
@@ -69,7 +69,9 @@ function unique_idf($row, $indexes) {
}
$return = array();
foreach ($row as $key => $val) {
- $return[] = (isset($val) ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
+ if (!preg_match('~^(COUNT\\((\\*|(DISTINCT )?`(?:[^`]+|``)+`)\\)|(AVG|GROUP_CONCAT|MAX|MIN|SUM)\\(`(?:[^`]+|``)+`\\))$~', $key)) { //! columns looking like functions
+ $return[] = (isset($val) ? urlencode("where[" . bracket_escape($key) . "]") . "=" . urlencode($val) : "null%5B%5D=" . urlencode($key));
+ }
}
return $return;
}
diff --git a/adminer/select.inc.php b/adminer/select.inc.php
index e503886e..429516dc 100644
--- a/adminer/select.inc.php
+++ b/adminer/select.inc.php
@@ -78,7 +78,7 @@ if ($_POST && !$error) {
} else {
foreach ((array) $_POST["check"] as $val) {
// where is not unique so OR can't be used
- $result = queries($command . "\nWHERE " . where_check($val) . "\nLIMIT 1");
+ $result = queries($command . "\nWHERE " . where_check($val) . (count($group) < count($select) ? "" : "\nLIMIT 1"));
if (!$result) {
break;
}
@@ -184,13 +184,13 @@ if (!$columns) {
if (strlen($name)) {
$order++;
$names[$key] = $name;
- echo '