Permalink
Browse files

Don't treat enum in PostgreSQL as special (bug #3545899)

  • Loading branch information...
1 parent 98483e1 commit a227ec1c97a138bc7561d5dc865f3769ee6e8a8f @vrana committed Jul 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 adminer/edit.inc.php
@@ -53,7 +53,7 @@
$select = array();
foreach ($fields as $name => $field) {
if (isset($field["privileges"]["select"])) {
- $select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : (ereg("enum|set", $field["type"]) ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
+ $select[] = ($_POST["clone"] && $field["auto_increment"] ? "'' AS " : ($jush == "sql" && ereg("enum|set", $field["type"]) ? "1*" . idf_escape($name) . " AS " : "")) . idf_escape($name);
}
}
$row = array();
@@ -76,7 +76,7 @@
echo "<tr><th>" . $adminer->fieldName($field);
$default = $_GET["set"][bracket_escape($name)];
$value = ($row !== null
- ? ($row[$name] != "" && ereg("enum|set", $field["type"]) ? (is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]) : $row[$name])
+ ? ($row[$name] != "" && $jush == "sql" && ereg("enum|set", $field["type"]) ? (is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]) : $row[$name])
: (!$update && $field["auto_increment"] ? "" : (isset($_GET["select"]) ? false : ($default !== null ? $default : $field["default"])))
);
if (!$_POST["save"] && is_string($value)) {

0 comments on commit a227ec1

Please sign in to comment.